0

I've been testing connections to various mail servers and encountered a problem with AOL:

Notice: Unknown: Can't connect to internal-aol.imap.mail.g03.yahoodns.net,143: Timed out (errflg=1) in Unknown on line 0

Now this looks like it's a problem on their end however I haven't been able to confirm that this configuration (beyond my user name and pass word) are valid.

Here is the code I'm using to test the connection:

<?php
echo '<pre>';
//AOL "generate app password": https://login.aol.com/myaccount/security/app-password/
$user = '__user__';
$password = '__password__';
$server = '{imap.aol.com:143/imap/novalidate-cert}';
//$server = '{imap.aol.com:143/imap/ssl}';
$connection = imap_open($server, $user, $password);

if ($connection)
{
 $mailboxes = imap_list($connection, $server,'*');
 echo '<pre>AOL Mailboxes: ';print_r($mailboxes);echo '</pre>'; 
 imap_close($connection);
}
echo '</pre>';
?>

Is the $server valid and secure?

I've also tried {imap.aol.com:143/imap/ssl} however that results in the following error:

Notice: Unknown: Can't connect to internal-aol.imap.mail.g03.yahoodns.net,143: Timed out (errflg=1) in Unknown on line 0

Also note that I've created and am using the "app password" as noted in the code.

John
  • 1
  • 13
  • 98
  • 177
  • 1
    I see you found it, but generally public IMAP servers never run unsecured on 143 anymore. Most run SSL on 993. Occasionally you may come across a `starttls` server on 143, but it's best to try 993 first. – Max Nov 13 '21 at 16:05
  • @Max Turns out there is a good tutorial on how to structure URLs for PHP (apparently) here: https://dcblog.dev/connecting-to-an-imap-server-using-imap-open. Yeah, I was at the mercy of what had been posted and what the search engines were returning for results. Luckily I caught the port number as being odd and that led me to the answer. – John Nov 14 '21 at 03:03

1 Answers1

0

The server address was wrong, the correct one is:

<?php
$server = '{imap.aol.com:993/imap/ssl}';
?>
John
  • 1
  • 13
  • 98
  • 177