Alan,

Appreciate the code very much. Thanks for sharing it.

FYI, I tried using it with my SMTP provider (Rackspace) who requires SSL and StartTLS. I kept getting an authorization error, login credentials were refused.

After some Googling, I found a bit of info that I can't confirm as true, but it does make sense as to why I can't get authorization to work with Rackspace SMTP.

Rather than try to repeat what was explained, I'll just insert it here:
==============================

Your provider needs to support STARTTLS (explicit SSL), which works originally over unencrypted ports like 25 and 587, if you want to use the Send-MailMessage or System.Net.Mail classes. From the MSDN documentation on these classes (athttp://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl(v=vs.110).aspx <http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl%28v=vs.110%29.aspx>) :

TheSmtpClient <http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient%28v=vs.110%29.aspx>class only supports the SMTP Service Extension for Secure SMTP over Transport Layer Security as defined in RFC 3207. In this mode, the SMTP session begins on an unencrypted channel, then a STARTTLS command is issued by the client to the server to switch to secure communication using SSL. See RFC 3207 published by the Internet Engineering Task Force (IETF) for more information.

An alternate connection method is where an SSL session is established up front before any protocol commands are sent. This connection method is sometimes called SMTP/SSL, SMTP over SSL, or SMTPS and by default uses port 465. This alternate connection method using SSL is not currently supported.
=======================================

Apparently, Rackspace, which requires port 465 for all SMTP communications requires implicit SSL, not explicit SSL.

But, again, thanks for the code sample! I understand it works well with Gmail.

Mike Copeland


Alan Bourke wrote:
For people having trouble with this, I have pasted the code into a Gist
instead, since I can't be bothered formatting it to fit the Fox Wiki
code tags, learning the markup for that etc. So try re-getting it from
here:

https://gist.github.com/anonymous/77919191364228819b6e

Note that in terms of sending some services are touchy about the 'from'
address. Office 365 online for example won't work unless the 'from'
address exactly matches the SMTP login name.




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to