Forums

gmail smtp not working in my website sometimes

i have hosted website to send the notifications via gmail. Sometimes it works fine but some occurred errors. I don't what is the reason. Below are the configurations

<h1>--- Mail Configuration ---</h1>

app.config['MAIL_SERVER'] = 'smtp.gmail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME'] = 'xxxxxxxxxx@gmail.com' app.config['MAIL_PASSWORD'] = '*** ' # IMPORTANT: Use a Google App Password app.config['MAIL_DEFAULT_SENDER'] = ('FCC-ALERT', 'xxxxxxxxxxxx@gmail.com') mail = Mail(app)

<h1>---------- ERROR -----------------</h1>

2025-10-29 22:29:46 Successfully sent transaction confirmation to jee*@gmail.com. 2025-10-30 09:54:17 Failed to send transaction confirmation to er@gmail.com: [Errno 101] Network is unreachable 2025-10-30 09:55:54 Failed to send transaction confirmation to mo*@gmail.com: [Errno 101] Network is unreachable

Google do not publish the ip addresses of their gmail smtp servers, so we make a good guess, but sometimes it's incorrect. You can try resending the email if you get that error message.