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

后端 未结 2 1097
旧巷少年郎
旧巷少年郎 2021-02-12 12:46

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条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-12 13:31

    Here's how:

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

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

提交回复
热议问题