TOPIC: How to enhance your VO application with X# - the SendMail DLL
How to enhance your VO application with X# - the SendMail DLL 1 year 7 months ago #1
| || |
Often some things are hard or impossible to accomplish in VO applications, but easy in X# applications because the .NET framework has the required functionalities.
One of the VO shortcomings is the possibility to send mail through GMail: SSL is required and the VO cSMTP classes cannot use SSL because the Windows API seems to not have the needed functionality.
Therefore I created a simple X# DLL, named SendMail.DLL that exposes a class interface ISmtpSender through COM and use this DLL in my VO applications.
You can find this DLL together with a VO sample application and the relative source code in XIDE export format attached to this message.
Of course you can enhance this DLL as needed, but please generate a new SNK file and new GUIDs for your own version. I'm using exactly this DLL in several of my applications.
The DLL must be located in the directory of the executable, otherwise SideBySide will not work.
The entire mechanism is a bit unstable until you understand how this works: it is a game between the COM interface of the DLL, the DLL manifest (generated by mt.exe) and the manifest of the executable. And please pay particular attention to the version info: they must match!
This is the content of the readme in the DLL source code:
1) create key file with sn - k sendmail.snk 2) after building and signing the DLL, read the public key with sn -T sendmail.dll (upper case T) 3) create the TLB with elevated rights regasm sendmail.dll /tlb 4) remove the registration regasm sendmail.dll /unregister 5) create the automation server in VO 6) add cClsID and cProdId in the Init method 7) create the manifest for the DLL mt.exe -managedassemblyname:sendmail.dll -nodependency -out:sendmail.dll.manifest 8) adjust the manifest (remove "msil" and add "win32") Caveats: - the namespace should be set also in the DLL properties, can be identical to the DLL file name - the class CANNOT have the same name as the DLL Debugging (if the VO application does not starts): sxstrace Trace -logfile:systrace.out sxstrace Parse -logfile:systrace.out -outfile:sxstrace.txt notepad sxstrace.txt
Last edit: by wriedmann.
How to enhance your VO application with X# - the SendMail DLL 1 year 7 months ago #2
| || |
A few days after posting this sample, I have received a email with the following text (quoting only the important part):
I have answered as follows: