How to simulate a “mailto:” call on Winforms Butto

2019-03-23 05:13发布

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?

2条回答
唯我独甜
2楼-- · 2019-03-23 05:41

Here's how:

Process.Start("mailto:foo@bar.com");

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

查看更多
女痞
3楼-- · 2019-03-23 05:45

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); 
}
查看更多
登录 后发表回答