I am able to send emails with SMTP to verify users after registration, the code works fine when I test. But the same code doesn't work if new user registers after an hour or 30mins, no emails are sent to them to verify.
I am getting the below logs. 2023-08-02 10:02:14,523: raise SMTPServerDisconnected("Connection unexpectedly closed") 2023-08-02 10:02:14,524: smtplib.SMTPServerDisconnected: Connection unexpectedly closed.
The email verification for concurrent user registrations fails with the same error. I had to manually reload the webapp every time user registration for them to get the email with SMTP setting.
Please let me know if there are ways to reload the webapp after user registration?