MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

SMTP SSL certifications  (Mono Support )

Viewed 33915 time(s), 2 post(s) 7/19/2013 7:38:01 AMby ruslanruslan
ruslanruslan

ruslanruslan

7/19/2013 7:47:13 AM
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?
This content has not been rated yet. 
123 Reputation 15 Total posts
khorvat

khorvat

7/22/2013 7:26:16 AM
Hi,

as I mentioned in previous post

you will have to build your own mail send functionality in order to add custom functionality. I can provide you with code snippets but you will have to let me know where do you want to include the above code ?
You will have to build your own mail sender if you plan to use this from code or you can set this via web.config as explained on MSDN,

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts