I saw a lot of conflicting stories about sending mail with attachments, so in
the end I just downloaded "Blat" (a command line mailer) and included it in
my app as a binary. I can then send mail using the RunProgram command.
You can download it from here:
http://www.interlog.com/~tcharron/blat.html
It is totally legal to use Blat in your own apps this way as it has been placed
in the Public Domain and its own docs state (in part): "you can use it free
of charge for any purpose you like [...] You have permission to modify,
redistribute, hoard, or even sell Blat in its executable or source form [...]"
Just remember to compress its exe before IncludeBinary'ing it into your app,
to keep the inclusion small. (It's not that large, anyway). Also, it's a good
idea to rename it from Blat.exe to YourApp.exe so that any firewalls will
refer to it by your app's name, so that your users don't panic and wonder
why an app called "Blat.exe" is trying to access the Internet.
Maybe one day someone will post some good (working) sendmail code to
these forums, that supports attachments, so Blat doesn't have to be used.