We need a C# method for sending emails.
We first tried the [url removed, login to view] class, but it does not support SSL with 465 port (it first connects to port 25 and then it switches to 465 - this does not work for us; we need direct connection to SSL 465).
We found the CDO message object and used CDO succesfully until our clients begun using TSL on port 587 with Secure Password Authentication (SPA). Even thought CDO seems to accept SPA (sort of), it does not work.
We need a method for sending SMTP emails with attachments using:
- SMTP with user and password;
- SSL or not SSL with port 25 (or other) or port 465 (with direct connection);
- TSL on port 587 (or other)
- Secure Password Authentication
Method must have the parameters:
SendEmailMessage(string FROM, string username, string SMTP_Server, int SMTP_Port, string Password, bool SSL, bool TLS, bool SPA, string TO, string CC, string BCC, string Subject, string Body, string HTMLBody, string attachments)
string attachments => contains the file location of the attachments that need to be sent with the email.
strings TO, CC and BCC => contain comma delimited emails
bool SSL and TLS specify if it is used TLS or SSL
bool SPA specify if Secure Password Authentication is used (this setting does not depend on other settings).