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 )

35980 put(a) pogledan, 2 odgovor(a) 19.7.2013. 7:38:01Kreirao(la) ruslanruslan
ruslanruslan

ruslanruslan

19.7.2013. 7:47:13
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?
Ovaj sadržaj još nije ocijenjen. 
123 Reputacija 15 Ukupno objava
khorvat

khorvat

22.7.2013. 7:26:16
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava