0
$host = 'outlook.office365.com';
$port = '995';
$username = 'test@hotmail.com';
$password ='testpassword';
$connection1 = imap_open('{'.$host.':'.$port.'/ssl/novalidate-cert}INBOX', 
$username, $password) or die('Cannot connect to Hotmail: ' . 
imap_last_error());

On Port 993 (IMAP) its working fine, but not for SSL. i am not sure what parameter will after port for SSL.

Saurabh Sharma
  • 430
  • 2
  • 11
  • As far as I know, 993 is the correct IMAP-port (with ssl/startTSL) and port 995 is for POP, not IMAP. So if you can connect to 993, you should already be set. – M. Eriksson Jun 20 '19 at 06:30
  • @MagnusEriksson thank you for comment, how can i connect with POP – Saurabh Sharma Jun 20 '19 at 07:11
  • You can [check this answer out](https://stackoverflow.com/a/3165058/2453432). Are you sure you want to use POP though? When fetching messages using POP, the messages will be removed from the server while IMAP leaves the messages on the server (which is usually preferred). – M. Eriksson Jun 20 '19 at 07:59
  • @MagnusEriksson, i tried the suggested answer but no luck, hotmail gives option in POP either delete or keep message – Saurabh Sharma Jun 20 '19 at 09:17
  • Reviewing this: can you clarify exactly what the problem is. Connecting to IMAP over SSL (993), POP (110), POP over SSL (995). `$mbox = imap_open ("{host:995/pop3/ssl/novalidate-cert}", "user_id", "password");` doesn't work for you for POP? – Robbie Jun 27 '19 at 05:53
  • @Robbie i am not getting any response while connecting POP over SSL (995) for Outlook – Saurabh Sharma Jun 27 '19 at 06:11
  • Have you tried the syntax I posted above? Include pop3 in the path. – Robbie Jun 27 '19 at 10:39
  • @Robbie, sorry for late reply, but your code is not working – Saurabh Sharma Jul 10 '19 at 05:53

0 Answers0