0 votes
by (120 points)
edited

Hi, We're trying to send mail via Hotmail and can get it to work fine using the standard .Net SmtpClient as below but cannot find the corresponding properties to do the same using the Rebex Mail components.

All is fine apart from the EnableSsl line which we're unable to find any way of setting. Is it possible with the Rebex components?

SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.live.com", 587);

smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("{my hotmail email}",
                                         "{my hotmail password}");

msg.From = new MailAddress("mymail@hotmail.com");
msg.To.Add("me@mydomain.com");

smtp.Send(msg);

Thanks, Ian

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (147k points)
edited

This is a corresponding code with Rebex Secure Mail:

Smtp smtp = new Smtp();
smtp.Connect("smtp.live.com", 587, null, SmtpSecurity.Explicit);
smtp.Login("{my hotmail email}", "{my hotmail password}");

MailMessage msg = new MailMessage();
msg.From = new MailAddress("mymail@hotmail.com");
msg.To.Add("me@mydomain.com");

smtp.Send(msg);

You have to specify SmtpSecurity.Explicit to enable SSL. Please not that this only works with Rebex Secure Mail - Rebex Mail doesn't support SSL.

by (160 points)
Thanks Lukas, that would explain it as we are only using Rebex Mail
...