I’m working on an app in which I need to send emails at intervals. I’m using python’s smtplib. When I host the app locally, I have no issues, but when it’s deployed, I run into mysterious problems: Everything seems to go smoothly - the logs say the email has sent, no exceptions, I’ve even set smtplib’s log level to debug and can see that the entire SMTP client-server communication seems to be successful - but the emails never arrive. I think I’ve controlled for all other differences: same sender/receiver, same data being sent, etc. The only difference is where it’s hosted. Here’s an example of a minimal email app that causes me issues: https://minimal.streamlit.app/. Run locally, I receive the emails; hosted, I do not - identical in the logs. Any ideas? This may not properly be a streamlit-responsible issue, but I wondered if anyone else has had a similar problem when using streamlit.
Thank you! I had seen this post, and I don’t believe it’s relevant to the particular issue I’m having. The emails send just fine from a local instance (just not from the deployment on streamlit cloud) and this is a private mail server which doesn’t have any multifactor authentication or any such thing. All passwords etc. are set up the same locally and in the deployment. I was wondering if perhaps streamlit cloud is being blocked in some way from sending requests to send emails (although, like I said, the smtplib logs don’t suggest that). Is streamlit ever blacklisted in any way that you know of?
It seems to me that it has to do with our private mail server. My guess is that it is somehow flagging streamlit-hosted apps as insecure. I’m not sure why no errors are thrown, but seeing as how it works when deployed locally and I’ve exhausted implementation options, I think I’ll just have to either host a new mail server that I have more fine-grained control over or host my streamlit app elsewhere.