Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate a "mailto:" call on Winforms Button Click?

I will send an email with a given address by open the standard email program like "mailto:" in an a-tag will do it, but within a button click.

How?

like image 526
PassionateDeveloper Avatar asked Feb 11 '10 09:02

PassionateDeveloper


2 Answers

Example from here

private void btnEmail_Click(object sender, EventArgs e)  
{ 
   string command = "mailto:info[at]codegain.com?subject=The Subject&bcc=vrrave[at]codegaim.com";  
   Process.Start(command); 
}
like image 181
Svetlozar Angelov Avatar answered Nov 06 '22 10:11

Svetlozar Angelov


Here's how:

Process.Start("mailto:[email protected]");

Additionally, you can PInvoke into ShellExecute to gain more control over this.

like image 12
Anton Gogolev Avatar answered Nov 06 '22 10:11

Anton Gogolev