How can I programatically open a new message window in the default email client (such as Outlook) using Windows API calls? I will need to include an attachment and would prefer to specify the default message body in 'rich text' (ie. not plain) format.
+1
A:
I think you can do this using the ShellExecute. An attachment should be used as parameter: something like this but I don't remember for sure: "mailto:emial@something?subject=subject?body=body?attachment=..."
sinec
2009-12-01 10:17:24
Thomas
2009-12-01 10:20:13
yes, you're right.
sinec
2009-12-01 12:36:31
Beaner
2009-12-02 16:54:45
+1
A:
The ShellExecute solution is good for simple messages without attachments, but if you want more control over the process, you may try the MAPI; in particular, see the MAPISendMail function and the MapiMessage structure.
For even more complex needs, there's the extended MAPI, but I didn't find any documentation about it on the MSDN. However this seems to be a good wrapper around the extended MAPI.
Matteo Italia
2009-12-02 01:21:28