open default mailclient, attachments

  • Thread starter Thread starter Christian H
  • Start date Start date
C

Christian H

Hello,

I'm trying to open the default mailclient , and add attachments to a new
message.
The closest I've come so far , is to use Diagnostics.Process (see below).
The problem, is that the attachments does not seem to be included.

I've seen this done with MAPI, with c++

Does anyone have a solution?

Christian H.


private void ExecuteFile(String s){
System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.FileName=s;
p.StartInfo.UseShellExecute=true;
p.StartInfo.RedirectStandardOutput=false;
p.Start();
p.Dispose();
}

private void OpenMailClient(){
System.Text.StringBuilder MsgBuilder =new System.Text.StringBuilder();
MsgBuilder.Append("mailto:[email protected]");
MsgBuilder.Append("&[email protected]");
MsgBuilder.Append("&[email protected]");
MsgBuilder.Append("&subject=this is test subject");
MsgBuilder.Append("&body=this is test body");
MsgBuilder.Append("&Attach=@c:\\sea.log");

ExecuteFile(MsgBuilder.ToString());
}
 
Back
Top