How to submission server of an email (SMTP)? [closed]
I will brief you about the situation I'm in, what issue I am facing and what I have tried.
I have set up a web app using flask, where users can send automated emails (not email campaigns) to a list of emails that they upload in excel. So if you register on the website as [email protected]
and upload a list of emails in excel, the app will automatically send emails to the ids listed through smtp.gmail.com
.
But as more users enroll for the web app from different domains, it is not possible for me to manually type in the SMTP server and port of the client. For instance, recently a client registered with email [email protected]
so I checked the MX records and found it was from domain 163mx03.mxmail.netease.com
and then I had to google for netease.com SMTP
which after few websites I found to be smtp.ym.163.com
at port 25.
I have already added all the major SMTP servers in the backend (like Gmail, outlook, Zoho) but still, there are new users from the different SMTP server.
- How can I address this issue? How to get dynamically the SMTP of the domain so that I can apply it to the user for sending email?
- Is there a way that I can get the SMTP server of the user (by asking them to send me an email)?
- Is there a way to tackle this issue by creating a new SMTP?
- Is there any way that I can send an email without providing the SMTP but just the email and password of the user?
There's no easy solution for your problem, but you can have a look at the way Mozilla Thunderbird attempts autoconfiguration of a user's email account. Details are here:
https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration
Most promising is the ISP database they maintain. This database can be queried through a special URL https://autoconfig.thunderbird.net/v1.1/{domainname} For instance, to lookup gmail.com:
https://autoconfig.thunderbird.net/v1.1/gmail.com