I am using Sendgrid for the mail service.
My Account is two factor authentication is enabled.
My .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=S4gYKuoPRBaOAy7qT__J8w
MAIL_PASSWORD=SG.APIKEYPASSWORD
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="Xyz Name"
MAIL_FROM_ADDRESS=xyz@xyz.com
If I execute the mail then I am getting below error.
Swift_TransportException : Failed to authenticate on SMTP server with username "S4gYKuoPRBaOAy7qT__J8w" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 250 but got an empty response. Authenticator PLAIN returned Expected response code 250 but got an empty response.
And If I disable the two-factor authentication then it works with the UserName and Password of the account but sendgrid will suspend my account if I do it like this.
Can anyone faced this issue. if yes then please let me know how you solved the problem.