I've been all day trying to find code that would allow me to launch the default email system with an attachment but I did not succeed. My app is written in python, and runs on windows. I did not succed with python with this post Python: launch default mail client on the system so, I tried with C# with this Post Open default mail client along with a attachment and some other information I found on the Internet. In this post the following line of code:
var mailWriter = mailWriterContructor.Invoke(new object[] { filestream });
raises an Error:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
I found the solution with Start-Process mailto:... and it opens the default email system with the attachment argument ignored, this is the code I use here:
C:\SomeDir> Start-Process "mailto:some.guy@someplace.com?subject=an email&body=see attachment&attachment='cost example.xlsx'"
The default email System is Thunderbird if that matters. I will keep searching for a solution. Any idea is welcome. Thanks.