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?

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); 
}
2

Here's how:

Process.Start("mailto:");

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest