Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a New MS Outlook email from c++ code

Status
Not open for further replies.

amroberts

Programmer
Jun 21, 2010
13
ZA
Hi guys, hope ur all having a good week.

I want to be able to click a button on a form and have a new ms outlook email window open with recipients' email addresses (that I get from a database) added to the "To" box.

Body text and subject can be blank.

Can anyone help?

Thanks in advance!

Andrew
 
Simply exec "mailto:name@provider.com" and the default e-mail provider should open with the address prefilled. Adding "?subject=My%20subject" could pre-fill the subject with "My subject" (quotes shouldn't show)
Possible parameters are explained here:
 
Thanks TonHu,

Here is the full line of code to execute:

ShellExecute(0, "open", "mailto:name@domain.com?subject=Hello&Cc=jane@domai%20n.com&bcc=joe@domain.com.&body=Hello%20world", 0, 0, 1);

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top