I would like my application’s users to be able to use all possible emails. Now if I think about it setting up if clauses to track their email provider in order to set an SmtpServer and SmtpServer.Port would be inefficient. Is there an easier way to do this?
I would like my application’s users to be able to use all possible emails.
Share
I’m not sure what you mean by “track their email provider”, but you absolutely do need to set an SMTP server to send email – you can’t do it otherwise.
If you don’t know what their SMTP server is ahead of time (which you won’t if it’s a desktop application, usually), the easiest thing to do is to provide a settings screen where the user sets their own SMTP information; port, SSL/not, username, password, etc; Then you will use those settings when creating the SMTP connection.