It seems that you need to enable SMTP Auth on Mircrosoft side of things: https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission
Mar 30, 2022
31
Level 1
Error while sending mail using office365 smtp details
I have created a custom authentication system using Otp and mailing. and I am using office365 SMTP details to send a mail to user who is just registering in or logging in. but while registering it takes too load and gives me an error as displayed below:
Swift_TransportException
Failed to authenticate on SMTP server with username "{email_id}" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visit https://aka.ms/smtp_auth_disabled for more information. [BMXPR01CA0027.INDPRD01.PROD.OUTLOOK.COM] ". Authenticator XOAUTH2 returned Expected response code 235 but got code "535", with message "535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visit https://aka.ms/smtp_auth_disabled for more information. [BMXPR01CA0027.INDPRD01.PROD.OUTLOOK.COM] ".
and my office365 SMTPdetails are shown below:
MAIL_MAILER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME={email_id}
MAIL_PASSWORD={app_password}
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS={email_id}
MAIL_FROM_NAME="${APP_NAME}"
is there any other method to send using office365 SMTPdetails in laravel 8
Please or to participate in this conversation.