currently i have website with form contact us that send email to me using other account email,
i'm using office 365 and phpmailer to handle it, but there some error if implementin my code.
Error :
2020-10-23 08:40:52 CLIENT -> SERVER: EHLO localhost
2020-10-23 08:40:52 CLIENT -> SERVER: STARTTLS
2020-10-23 08:40:52 CLIENT -> SERVER: EHLO localhost
2020-10-23 08:40:52 CLIENT -> SERVER: AUTH LOGIN
2020-10-23 08:40:52 CLIENT -> SERVER: aW5mb0BvYmYxxxx
2020-10-23 08:40:52 CLIENT -> SERVER: Z3R2Z3hneW55d2xxxxxxxx 2
020-10-23 08:40:58 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [SG2PR06CA0187.apcprd06.prod.outlook.com]
2020-10-23 08:40:58 SMTP Error: Could not authenticate.
2020-10-23 08:40:58 CLIENT -> SERVER: QUIT
2020-10-23 08:40:58 SMTP Error: Could not authenticate.
my code :
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'STARTTLS';
$mail->Host = 'smtp.office365.com';
$mail->Port = 587;
$mail->Username = 'info@abc.com';
$mail->Password = 'password';
$mail->Subject = $subject;
could someone help me using office 365 in phpmailer?
SMTPDebug = 2
so that you can see what the server is saying, and show us the results. Also setSMTPSecure = 'tls'
; the value you made up has no meaning to PHPMailer. – Synchro Oct 26 '20 at 11:09