I dabbled a bit with SChannel for encrypted sessions with SMTP mail servers. Not sure when I'll get 'er finished up. Attached is a PBWin source file with the EXE. Since I hadn't run the code for a bit, I ran it against:
smtp.gmail.com
smtp.mail.yahoo.com
smtp.ntlworld.com
outgoing.verizon.net
smtp.mail.com
with port 465 and didn't see any obvious errors. All the code is doing, is the SSL handshake, then retrieve the server greeting and sending an EHLO before disconnecting. There is a trace file created during the run that you can open after getting the trace complete message and see what went on.
I know the code is quite rough with only basic error detection. Additionally, I still have to figure out when MSDN is referring to as "extra" buffers and the %SEC_E_INCOMPLETE_MESSAGE (and session renegotiations) and at least it is a basic working model if anybody wants to play around. The function calls are sequenced for port 465/SSL and not 587/TLS.
Jump in and see what you can do! It would be nice to have a complete SMTP class with SSL support which I'll create when all this SSL stuff gets figured out.
Rick Kelly
p.s. Vista+ and Jose's includes
I have the beginnings of a SMTP class going on and started a thread on the PB forums at:
http://www.powerbasic.com/support/pbforums/showthread.php?t=59221 (http://www.powerbasic.com/support/pbforums/showthread.php?t=59221)
Of course, the class will require Jose's includes and Vista+.
Rick Kelly
I'm in the final stages of testing. If you want to help out, see:
http://www.powerbasic.com/support/pbforums/showthread.php?t=59221
Rick Kelly
Source now at:
http://www.powerbasic.com/support/pbforums/showthread.php?p=476779#post476779