SmtpClient.EnableSsl equivalent property in Rebex.Mail

0 votes
asked Jul 21, 2010 by Ian_ (120 points)
edited Mar 31, 2011

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
answered Jul 22, 2010 by Lukas Pokorny (86,990 points)
edited Jul 22, 2010

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.

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