Hi!
I've got problem with my SMTP server. This server is used by Exchange server, that is why it includes ssl certifications.
Using this demo code is to say that it wouldn't work until i'll uncomment server certificate row:
SmtpClient SmtpServer = new SmtpClient();
MailMessage mail = new MailMessage();
mail.From = new MailAddress("qwe@qwe.com");
mail.Sender = new MailAddress("qwe@qwe.com");
mail.To.Add("qwe@yandex.ru");
mail.Subject = "new";
mail.Body = "Report";
SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
SmtpServer.Port = 587;
SmtpServer.UseDefaultCredentials = true;
SmtpServer.Credentials = new NetworkCredential("DC.local\\qwe", "P@qwe");
SmtpServer.EnableSsl = true;
try
{
// ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
SmtpServer.Send(mail);
}
The problem is that I don't know how to use MonoX with this SMTP server. How can I specify certification settings in web.config or some wear else just to let MonoX successfully send messages?