Microsoft Please Help - Mailto + Attachments + WinForm

G

Guest

Unfortunately ... my C# WinForm app needs to support both microsoft outlook and novell groupwise email clients

In a WinForm, it's easy to mimic IE's mailto: functionality

using System.Diagnostics
..
string MyCmd = "mailto:[email protected]?subject=My%20Subject&body=My%20body"
Process.Start(MyCmd)

But every attempt to include an attachment DOES NOT WORK! I've researched this for almost a day and found many references showing MAILTO from WinForms but NONE of the references said they got ATTACHMENTS to work

I believe this should work

string MyCmd = "mailto:[email protected]?subject=My%20Subject&body=My%20bodyt&attachment=\"C:\\myfile.txt\""

But it generates error ...

"Cannot start Microsoft Outlook. The command line argument is not valid. Verify the switch you are using.

I found four Microsoft Knowledge base articlesabout the error (312346, 827593, 222338, 823923) but they were no help

Maybe I'm approaching this problem the wrong way
Maybe using Process.Start is the wrong answer
Is there another way to fire the user's DEFAULT smtp-compliant email app whether that be Outlook, OutlookExpress, or GroupWise? And include attachments
 
C

Christoph Nahr

Unfortunately ... my C# WinForm app needs to support both microsoft outlook and novell groupwise email clients.

You'll have to use MAPI via P/Invoke. The Process.Start method can't
handle attachments, unfortunately.
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?Rmxhc2hNZXJsb3Q=?= said:
Unfortunately ... my C# WinForm app needs to support both microsoft outlook and novell groupwise email clients.

In a WinForm, it's easy to mimic IE's mailto: functionality.

using System.Diagnostics;
...
string MyCmd = "mailto:[email protected]?subject=My%20Subject&body=My%20body";
Process.Start(MyCmd);

But every attempt to include an attachment DOES NOT WORK!

.... because it's not supported by the mail client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top