I have to run ArGoSoft Mail Server in a secure way and I have already received a .PFX certificate from a certificate authority.
Then I pointed the .PFX file by clicking on Security - Server Certificate - Use from PFX file.
After that I clicked on Options - Services and made the following changes:
In SMTP section, Disable STARTTLS Unchecked
In Secondary SMTP section, Disable STARTTLS Unchecked
In POP3 section, Disable STLS Unchecked
In Delivery section, Use STARTTLS when possible Checked
I believe these are the necessary steps to run the ArGoSoft Mail Server in TLS.
Then I tried to run following C# code with EnableSsl flag to true, but I received an exception as "Server does not support secure connections.". Am I missing any steps? Please help.
try
{
SmtpClient client = new SmtpClient("mail server domain, 587);
client.Credentials = new System.Net.NetworkCredential("username", "password");
client.EnableSsl = true;
client.UseDefaultCredentials = true;
MailMessage message = new MailMessage("from email address", "to email address", "email subject", "email body");
client.Send(message);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}