I am working on a wpf app, and I have a Customer Information section where I can record my customer information. In this section, I use a textbox recording customer\'s email add
you can try code XAML
Refer a friend
code behind
private void tbReferAFriend_MouseDown(object sender, MouseButtonEventArgs e)
{
try
{
LaunchEmailClientByShellExecute();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
}
}
[DllImport("shell32.dll")]
public static extern IntPtr ShellExecute(IntPtr hwnd, string lpOperation,
string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
private void launchEmailClientByShellExecute()
{
ShellExecute(IntPtr.Zero, "open", "mailto:username?subject=Read%20This&body=message%20contents", "", "", 4/* sw_shownoactivate */);
}
from : https://social.msdn.microsoft.com/Forums/vstudio/en-US/dcbaaced-97b3-4276-bf95-960e77cb6c03/how-to-launch-default-mail-client-in-wpf-applications?forum=wpf