Describe the bug
Using SmtpClient.Connect( "smtp.office365.com", 587, true) does not work in the case of 365, and needs to be explicitly used as: SmtpClient.Connect( "smtp.office365.com", 587, SecureSocketOptions.StartTls).
To Reproduce
Use Connect( "smtp.office365.com", 587, true);
Expected behavior
Connecting to the smtp server (understanding by itself office 365 uses STL and not SSL).
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional Note
The exception that is being throwen is:
MailKit.Security.SslHandshakeException: 'An error occurred while attempting to establish an SSL or TLS connection. One possibility is that you are trying to connect to a port which does not support SSL/TLS. The other possibility is that the SSL certificate presented by the server is not trusted by the system for one or more of the following reasons:
See https://github.com/jstedfast/MailKit/blob/master/FAQ.md#InvalidSslCertificate for possible solutions.'
Aditonal Context
This is not a big bug, but i tought it would be good to point it out here so maybe it will be fix :)
a google search would find the fix pretty fast : https://stackoverflow.com/questions/41872812/mailkit-c-sharp-smtpclient-connect-to-office-365-generating-exception-an-exi (first search result for "mailkit with office 365")
This isn't a bug.
The bool useSsl argument is for port 465 only because it tells MailKit to use an SSL-wrapped connection which is entirely different from STARTTLS.
Most helpful comment
This isn't a bug.
The
bool useSslargument is for port 465 only because it tells MailKit to use an SSL-wrapped connection which is entirely different from STARTTLS.