It doesn't work with my mail server requiring STARTTLS authentication. That's not covered by this code.
>ERROR [250-PIPELINING250-8BITMIME250-STARTTLS250 AUTH LOGIN PLAIN] -> ERR09
Looking for anything more to setup up in the VFP_Winsock_Send_Mail class about authentication the way it's necessary for secure connections, I don't find anything. Today mail servers requiring secure login are the norm and Atout Fox will need to add this feature to make it usable again.
If you want to depend on the least MAPI is already a very fine solution, works for this case. CDO is too, but Thunderbird doesn't seem to set up CDO.Configuration. That's not impossible, but you need to go into the details about how that's done.
Besides that, this VFPwwinsock code is the least dependent on anything, but for the price of going very low level. The version history shows that from version 1.05 onwards it's not even using the Winsock.OCX anymore, it uses the WS2_32.DLL. So not only no external components, no OCX. This is an OS DLL. The Winsock.OCX is from MS, too, but not standard anymore. Still, it would only be complete, if it supports advanced authentication, Koen, therefore I wouldn't recommend VFPwinsock.
MAPI will be as safe as your mail client allows, and Thunderbird allows connections to be made via SSL/TLS or STARTTLS. So in this way, MAPI automatically updates with the capabilities of mail clients. As long as you have one and as long as MAPI remains a Windows OS standard for addressing mail clients. I don't even know a mail client that isn't supporting MAPI unless you'd roll your own mail client for example with that code. And to be clear: Using MAPI means you only communicate with a mail client in a standard way MS has foreseen for that, the mail client then puts your sent mail into it's sent items as one benefit and cares for the mail server, not only about connection but retries, etc.
I'm all eyes and ears, how you'd solve that, Koen, it would be okay to have that. No matter if as an external add-on establishing an SSL tunnel first, or as an extension of VFPwinsock. For several reasons:
1. Atout Fox is an active community and so that code is maintained. Unlike Craig Boyd, whos series of sending mail in different ways isn't even complete in his blog.
2. It allows sending HTML Mail, which simple MAPI does not. Some clients can be used in the tricky way to leave the text body empty and add an HTML attachment, which is then made the HTML mail body, but Thunderbird does not do that.
3. The ExtendedMAPI.FLL that exists from Craig Boyd has comments stating it's only working when the user is in the admin group of a system. So while it also allows HTML emails, that's an obvious minus.
4. It could be the basis of usage on servers, where installation of mail clients is not the norm and unless you're running on the server that also runs Exchange, CDO also isn't an option.
There is another alternative you also find googling: Using blat with VFP. That also has all the features and all it adds to the distribution process is that single DLL. It makes use of the same C runtime the OS uses, still, just one version covers all OSes from 2000 up to Win10. So using and distributing that doesn't need any advanced merge module installation step or registering.
Bye, Olaf.
Olaf Doschke Software Engineering