0

I'm trying to send an email by PHP code:

$mailto = 'to@outlook.com';
$mailSub = 'test';
$mailMsg = 'test';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer-master/src/Exception.php';
require 'PHPMailer-master/src/PHPMailer.php';
require 'PHPMailer-master/src/SMTP.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.live.com";
$mail->SMTPAuth= true;
$mail->Port = 587;
$mail->Username= "sender@outlook.com";
$mail->Password= "senderpassword";
$mail->SMTPSecure = 'tls';
$mail->From = "sender@outlook.com";
$mail->FromName= "test";
$mail->isHTML(true);
$mail->Subject =  $mailSub ;
$mail->Body = $mailMsg;
$mail->addAddress($mailto);
  if(!$mail->Send())
  {
     echo "Mail Not Sent". $mail->ErrorInfo;
 }
 else
  {
     echo "Mail Sent";
 }

I Get this error :

Mail Not Sent SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message WASCL UserAction verdict is not None. Actual verdict is HipNotify, ShowTierUpgrade. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is HipNotify, ShowTierUpgrade. [Hostname=AM0PR0402MB3714.eurprd04.prod.outlook.com] SMTP code: 554 Additional SMTP info: 5.2.0

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34
  • Go take a look on the following link : https://stackoverflow.com/questions/15880042/phpmailer-the-following-smtp-error-data-not-accepted – Lalati May 14 '19 at 11:21
  • See the link below https://stackoverflow.com/questions/24576389/phpmailer-gives-error-data-end-command-failed-and-data-not-accepted-without – Justin J May 14 '19 at 11:23

1 Answers1

0

try to add

$mail->SMTPDebug = 2;

It may be something like that you're exceeding maximum message size.

Justin J
  • 808
  • 8
  • 14