I\'m trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML
template.
<
Try to set the port on 26, this has fixed my problem with the message "data not accepted".
your server dosen't allow different sender and username
you should config: $mail->From
like $mail->Username
If you are using the Office 365 SMTP gateway then "SMTP Error: data not accepted." is the response you will get if the mailbox is full (even if you are just sending from it).
Try deleting some messages out of the mailbox.
I was experiencing this same problem. In my instance the send mail was timing out because my Exchange server was relaying email to a server on the internet. That server had exceeded it's bandwidth quota. Apparently php mailer has some built in timeout and it wasn't long enough to see the actual message.
First you better set debug to TRUE:
$email->SMTPDebug = true;
Or temporary change value of public $SMTPDebug = false; in PHPMailer class.
And then you can see the full log in the browser. For me it was too many emails per second:
...
SMTP -> FROM SERVER:XXX.XX.XX.X Ok
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "XXX.XX.XX.X Requested action not taken: too many emails per second "
SMTP -> get_lines(): $data is "XXX.XX.XX.X Requested action not taken: too many emails per second "
SMTP -> FROM SERVER:XXX.XX.XX.X Requested action not taken: too many emails per second
SMTP -> ERROR: DATA command not accepted from server: 550 5.7.0 Requested action not taken: too many emails per second
...
Thus I got to know what was the exact issue.
in my case I was using AWS SES and I had to verify both "FromEmail" and "Recipient". Once done that I could send without problems.