473,379 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

open default mailclient, attachments

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:te**@testmail.com");
MsgBuilder.Append("&c********@testcc.com");
MsgBuilder.Append("&b*********@testbcc.com");
MsgBuilder.Append("&subject=this is test subject");
MsgBuilder.Append("&body=this is test body");
MsgBuilder.Append("&Attach=@c:\\sea.log");

ExecuteFile(MsgBuilder.ToString());
}

Nov 16 '05 #1
1 1838
I think this functionality is not implemented in .NET.
But you can create your own SMTP client or use already existing solution.
e.g.
* Parts from: "A class for sending emails with attachments in C#"

* url: http://www.codeproject.com/csharp/smtpemailer.asp

* provided by Steaven Woyan, sw****@hotmail.com

*

* See also "A Web based SMTP client program" by Ravindra Sadaphule

* url: http://www.codeproject.com/aspnet/smtpmail.asp

"Christian H" <n@n.no> wrote in message
news:NB********************@news2.e.nsc.no...
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:te**@testmail.com");
MsgBuilder.Append("&c********@testcc.com");
MsgBuilder.Append("&b*********@testbcc.com");
MsgBuilder.Append("&subject=this is test subject");
MsgBuilder.Append("&body=this is test body");
MsgBuilder.Append("&Attach=@c:\\sea.log");

ExecuteFile(MsgBuilder.ToString());
}

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MaxH | last post by:
I need to perform programmatically from a C# .net application the following tasks: _ open an outlook (or default e-mail client) compose message window; _ attach a document to the new message; _...
3
by: Gama Franco | last post by:
Hi, I'm working on a project based in Windows Forms, and I need to open the user's default e-mail client (a new e-mail) with some attachments ready to send. Since the destination of the e-mail...
2
by: Landley | last post by:
Hello, Is there a way of creating an email, attaching a file and sending using the client's default mail client? I am looking for a none email client specific solution that does not involve...
7
by: (PeteCresswell) | last post by:
I've got a UNC. It's something like H:\CDL\Attachments\Deal000023.InitialOffering.doc. I want to feed that UNC to MS Windows and let Windows worry about selecting which application to use to...
2
by: Hanika | last post by:
Going on 3 days and I am wodnering if I am just not looking in the right place. If anyone nows how to do this please please help me. I am developing a Windows form application using VB.NET 2005....
14
by: C | last post by:
Hi, From my ASP.NET application when the user clicksa button I want to be able to programmatically open Outlook, create a new mail, add attachments and set the body text. Is this possible? ...
1
by: Christof Nordiek | last post by:
From my application, informations can be sendt by the user. Until now I'm using Process.Start("mailto:....) This works very fine, but I get problems, when the preset content is to much, because...
2
by: Claire | last post by:
I'm a noob at emailing from code and I need to add email capabilities to my application. The following code completes without exceptions but I'm not receiving any test emails. How do you debug...
1
by: santosh singh | last post by:
for mobile browser i used the following code : Response.ContentType = "application/vnd.wap.xhtml+xml"; Response.AppendHeader("Content-Disposition","attachment; filename=SailBig.jpg");...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.