1

In my WPFapplication I need to be able to open the default email to send an email with attachment previously scanned. For the scanner i used WIA and I save the scanned image in jpeg. For email i has tried the MAILTO as follows

string mail1 = "abc@hotmail.com";
        string mail2 = "def@yahoo.it";
        string attach = @"C:\bla\bla\bla\file.xlsx";

        Process.Start(string.Format("mailto:{0}?subject={1}&body={2}&CC={3}&attachment:{4}"
                                       , mail1, subject, body, mail2,attach));

every thing works unless ATTACHMENT when Process.start opens the default email.

you know something better than mailto? or something that gives the ability to attach files to email?

Disaji
  • 89
  • 2
  • 11
  • 2
    you can use `SmtpClient` in `System.Net.Mail` namespace – dub stylee Apr 14 '17 at 21:49
  • @dubstylee thankyou I had already used it but I do not understand how to use it with the default email without having to enter all fields. you have an advice for me on how to do? – Disaji Apr 14 '17 at 21:59
  • Does this answer your question? [C# MailTo with Attachment?](https://stackoverflow.com/questions/1195111/c-sharp-mailto-with-attachment) –  Apr 07 '20 at 04:41

1 Answers1

1

You can upload that file to a server, get a URL and include it into mailto body as a link.

alper
  • 308
  • 2
  • 7
  • Ozhan Thanks i am a beginner with c# but i will try! If you have an example to link me is greatly appreciated ;-) – Disaji Apr 14 '17 at 22:13