简体   繁体   中英

Open default mail client window with attachment using c#

I have tried below ways to achieve this,

     1, mailto:
     2, Registrykeys  - @"HKEY_CLASSES_ROOT\mailto\shell\open\command", "", "none");
     3, proc.StartInfo.FileName = string.Format("\"{0}\"", Process.GetProcessesByName("OUTLOOK")[0].Modules[0].FileName);

But this always returns outlook window only. But I want to open default mail client window like out attached Image.

Please share me your answers.

This code should send mail using default mail provider in windows

var url = "mailto:emailnameu@domain.com&attachment=a.txt";
System.Diagnostics.Process.Start(url);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM