PHPmailer — AOL smtp ошибки подключения

Кто-нибудь знает правильные настройки для использования PHPMailer с AOL. Код ниже работал с outlook.com, но aol.com продолжает отказываться от него. Код выглядит следующим образом;

<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

//Load Composer's autoloader
require 'vendor/autoload.php';

$mail = new PHPMailer(true);                                           // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 2;                                              // Enable verbose debug output
$mail->isSMTP();                                                   // Set mailer to use SMTP
$mail->Host = 'smtp.aol.com';                                      // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                                            // Enable SMTP authentication
$mail->Username = 'xxxxxxxxxxxxxxxxxxx@aol.com';                        // SMTP username
$mail->Password = 'yyyyyyyyyyyyyyyyyyyyyy';                                     // SMTP password
$mail->SMTPSecure = 'ssl';                                         // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465;                                                 // TCP port to connect to

//Recipients
$mail->setFrom('xxxxxxxxxxxxxxxxxxx@aol.com', 'Barry AOL');
$mail->addAddress('xxxxxxxxxxxxxxxxxxx@gmail.com', 'Barry gmail');      // Add a recipient
//Content
$mail->isHTML(true);                                               // Set email format to HTML
$mail->Subject = 'Here is the subject - sent from AOL.com ';
$mail->Body    = 'This is the HTML message body <b>in bold!</b> - sent from AOL.com ';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients - sent from AOL.com ';

$mail->send();
echo 'Message has been sent from AOL.com ';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}

Я получаю следующие сообщения об ошибках от PHPMailer и aol.com;

2018-04-22 21:44:56 SERVER -> CLIENT: 521 5.2.1 : AOL will not accept delivery of this message.
2018-04-22 21:44:56 SMTP ERROR: DATA END command failed: 521 5.2.1 : AOL will not accept delivery of this message.
SMTP Error: data not accepted.
Message could not be sent. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: : AOL will not accept delivery of this message. SMTP code: 521 Additional SMTP info: 5.2.12018-04-22 21:44:56 CLIENT -> SERVER: QUIT
2018-04-22 21:44:56 SERVER -> CLIENT:
2018-04-22 21:44:56 SMTP ERROR: QUIT command failed:

Я предполагаю, что я неправильно понял настройки сервера, порта и SMTPSecure, но не могу понять, какими они должны быть. Кстати, при правильных изменениях сервера, порта и SMTPSecure код работает для outlook.com.

Это работает на рабочем столе MS Windows 10 с Apache / 2.4.27 (Win64) и PHP версии 7.0.9.

0

Решение

Эта статья должен использовать официальный SMTP-сервер (бесполезно скрытый под «POP3» & IMAP «), и вы, похоже, используете правильные данные.

Это может быть проблема фильтрации спама; попробуйте установить $mail->XMailer = ' '; (в этих кавычках есть пробел) для подавления идентификации PHPMailer.

Эта ошибка кажется очень субъективной на стороне AOL — если вы ищете это сообщение об ошибке, вы найдете миллионы результатов поиска, и вы увидите, что другие разделяют их разочарование Вот а также Вот

В противном случае я бы рекомендовал связаться с Поддержка AOL Postmaster.

0

Другие решения

Попробуйте удалить слово «AOL» из отображаемой части вашего адреса «От». Поскольку большинство клиентов отображают отображаемое имя только при перечислении почты, AOL не нравится имена, которые выглядят так, как будто они с официальных адресов AOL.

0