HawaiiDragon
asked on
how do I create email from a windows program
I am trying to create a windows app that will automaticaly launch outlook with the email populated as id does in ASP apps but this is inside a windows app on a button click. Does anyone have any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
right I looked at that but I just wanted to launch Outlook. With the email address pre populated like a web app does.
for some reason "mailto:XXX@example.com" will not work the way it does in a web app
for some reason "mailto:XXX@example.com" will not work the way it does in a web app
ASKER
oh yea and im trying to do it on a button click. Yea I know im complicated.
ASKER
man I sooooooo overlooked that sorry im a goof ball ... 2 days with no sleep will do that one
Well for your button click, you would do something like in the snippet. The way I wrote the code above, Process.Start will try to execute the "mailto..." command using the default application that is registered on you system to handle mailto links. If Outlook is your default email program, then Outlook should open when this line is executed.
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("mailto:example@example.com?subject=Hello%20Tiger&body=Just%20wanted%20to%20say%20hey!")
}
Open in new window