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?
HawaiiDragonAsked:
Who is Participating?
 
käµfm³d 👽Commented:
A really cheap way to do it would be to use Process.Start:
System.Diagnostics.Process.Start("mailto:example@example.com?subject=Hello%20Tiger&body=Just%20wanted%20to%20say%20hey!")

Open in new window

0
 
käµfm³d 👽Commented:
A really cheap way to do it would be to use Process.Start:
System.Diagnostics.Process.Start("mailto:abc@example.com?subject=Hello%20Tiger&body=Just%20wanted%20to%20say%20hey!")

Open in new window

0
 
HawaiiDragonAuthor Commented:
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
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
HawaiiDragonAuthor Commented:
oh yea and im trying to do it on a button click. Yea I know im complicated.
0
 
HawaiiDragonAuthor Commented:
man I sooooooo overlooked that sorry im a goof ball ... 2 days with no sleep will do that one
0
 
käµfm³d 👽Commented:
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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.