• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

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?
0
HawaiiDragon
Asked:
HawaiiDragon
  • 3
  • 3
1 Solution
 
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
 
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
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now