Initiate Sending EMail from C++
-
I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).
-
I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).
Have a look at Articles on MAPI. You can't guarantee that a MAPI client is available however. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
-
I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).
The simpliest way is to use the ShellExecute() function, specifying the email address in the lpFile parameter
ShellExecute (NULL, "open", "mailto:who@where.ever", NULL, NULL, SW_SHOW);
You can also specify the subject, cc, and bcc in the lpFile parameter
ShellExecute(NULL, "open", "mailto:who@where.ever&cc=you@them.org&bcc=them@you.org&subject=hello", NULL, NULL, SW_SHOW);
If you want to add text or attachments then have a look at SIMPLE MAPI
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).
-
The simpliest way is to use the ShellExecute() function, specifying the email address in the lpFile parameter
ShellExecute (NULL, "open", "mailto:who@where.ever", NULL, NULL, SW_SHOW);
You can also specify the subject, cc, and bcc in the lpFile parameter
ShellExecute(NULL, "open", "mailto:who@where.ever&cc=you@them.org&bcc=them@you.org&subject=hello", NULL, NULL, SW_SHOW);
If you want to add text or attachments then have a look at SIMPLE MAPI
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
Thank you; this is obviously the simplest solution. Exactly, what I needed in this situation. One remark: the show comman flag (SW_SHOW, or whatever else) has no effect in this case. The documentation states, that it is only for the case, then an executable file is specified. I tested it with "mailto", and it makes no difference.
-
Have a look at Articles on MAPI. You can't guarantee that a MAPI client is available however. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
-
I'm quite partial to this. A good place to start, at least.
You left me high and dry and changed me You lied to me and now i’m angry**...**