Call Us: 992 9441 754

SMTP Error: 535 5.7.8 Username and Password Not Accepted for Gmail in Go

< All Topics

SMTP Error: 535 5.7.8 Username and Password Not Accepted for Gmail in Go

The SMTP error “535 5.7.8 Username and Password not accepted” typically occurs when there’s an issue with the authentication credentials (username and password) provided for sending emails via Gmail’s SMTP server.

To resolve this error in a Go application, ensure that you’re using the correct Gmail SMTP settings and that the username and password are entered correctly.

Here’s a basic example of how to send an email using Gmail’s SMTP server in Go:

Ensure that you replace "your-email@gmail.com" and "your-password" with your actual Gmail email address and password. Also, replace "recipient@example.com" with the email address of the recipient.

Additionally, make sure that your Gmail account allows access for less secure apps. You can enable this option in your Gmail account settings under “Security” > “Less secure app access”.

If you have two-factor authentication enabled for your Gmail account, you may need to generate an app password specifically for your Go application and use that instead of your regular Gmail password.

By ensuring that you have the correct SMTP settings and authentication credentials, you should be able to resolve the “535 5.7.8 Username and Password not accepted” error when sending emails via Gmail in your Go application.

Categories

Recent Comments

No comments to show.