如何在Winforms按钮上模拟"mailto:"调用点击?

Kov*_*ovu 19 email button winforms

我将发送一个带有给定地址的电子邮件,打开标准电子邮件程序,如"mailto:",在a-tag中即可完成,但只需点击一下按钮.

怎么样?

Sve*_*lov 31

这里的例子

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); 
}
Run Code Online (Sandbox Code Playgroud)


Ant*_*lev 10

这是如何做:

Process.Start("mailto:foo@bar.com");
Run Code Online (Sandbox Code Playgroud)

此外,您可以通过PInvoke进入ShellExecute以获得对此的更多控制.