mailto

Started by
4 comments, last by Verg 18 years, 8 months ago
I want to add a button in my current Win32 project that allows the user to use their default email client to send an email message. I have it set up like this: WinExec("explorer \"mailto:aaa@aaa.com?subject=aaa\""); This works fine, except that it opens up a bogus browser window also. Does anyone have a better solution for this? Thanks, Joe
Advertisement
Tried "start mailto:\"aaa@aaa.com?subject=aaa\"" ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I tried that also, but it doesnt show -any- windows. I also looking into the command line args for explorer/start, but that didnt yield anything useful either.
Maybe ShellExecute instead of WinExec?

ShellExecute("mailto:aaa@aaa.com?subject=aaa");
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Thanks, that worked. Didn't know about that function:

ShellExecute(m_hWnd, "open", "mailto:aaa@aaa.com?subject=aaa", NULL, NULL, SW_SHOW);
Have a look at Simple MAPI; I'm using that currently, and it's very easy.
my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]

This topic is closed to new replies.

Advertisement