473,698 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Pro cess (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(Str ing s){
System.Diagnost ics.Process p=new System.Diagnost ics.Process();
p.StartInfo.Fil eName=s;
p.StartInfo.Use ShellExecute=tr ue;
p.StartInfo.Red irectStandardOu tput=false;
p.Start();
p.Dispose();
}

private void OpenMailClient( ){
System.Text.Str ingBuilder MsgBuilder =new System.Text.Str ingBuilder();
MsgBuilder.Appe nd("mailto:te** @testmail.com") ;
MsgBuilder.Appe nd("&c********@ testcc.com");
MsgBuilder.Appe nd("&b********* @testbcc.com");
MsgBuilder.Appe nd("&subject=th is is test subject");
MsgBuilder.Appe nd("&body=this is test body");
MsgBuilder.Appe nd("&Attach=@c: \\sea.log");

ExecuteFile(Msg Builder.ToStrin g());
}

Nov 16 '05 #1
1 1849
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******** ************@ne ws2.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.Pro cess (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(Str ing s){
System.Diagnost ics.Process p=new System.Diagnost ics.Process();
p.StartInfo.Fil eName=s;
p.StartInfo.Use ShellExecute=tr ue;
p.StartInfo.Red irectStandardOu tput=false;
p.Start();
p.Dispose();
}

private void OpenMailClient( ){
System.Text.Str ingBuilder MsgBuilder =new System.Text.Str ingBuilder();
MsgBuilder.Appe nd("mailto:te** @testmail.com") ;
MsgBuilder.Appe nd("&c********@ testcc.com");
MsgBuilder.Appe nd("&b********* @testbcc.com");
MsgBuilder.Appe nd("&subject=th is is test subject");
MsgBuilder.Appe nd("&body=this is test body");
MsgBuilder.Appe nd("&Attach=@c: \\sea.log");

ExecuteFile(Msg Builder.ToStrin g());
}

Nov 16 '05 #2

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

Similar topics

2
768
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; _ set message attributes How can I do it? Thank you.
3
18245
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 is unknow at this point I can't send it using the SmtpMail.Send() method. And because of the attachments I'm not able to open the new e-mail using the "mailto:" technique. Is there any other way to solve this problem keeping in mind that the
2
10692
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 specifying parameters such as mail servers etc. Cheers,
7
7505
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 open it. If there's no app defined for that UNC's particular suffix, that's ok... we'll live with it. Seems like a FileSystemObject should be able to do this, but I can't find such a method.
2
31990
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. I have a PDF file that I want to attach to the local default email client and display it so that the user can enter the rest of the information. Like one would see using the right-click Send To Mail Recipient. I tried using MailTo. But the...
14
5184
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? C.
1
5013
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 the length of the URL is restricted. IIRC this also can be solved by MAPI, but I can't find any example how to do this with C#. Is this really possible and can anyone give me a hint, how to do this?
2
3214
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 this? Ive checked my bad mail folder, and other IIS similar folders and they're empty. Can the mail classes be used without having a SMTP server running on localhost? Can you use any smtp server that's capable of being set up from a PC, e.g. an ISP...
1
1728
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"); Response.TransmitFile( Server.MapPath("~/images/sailbig.jpg") ); but this code is not able to open "Save as dialog box " on mobile Emulator Browser .Could anyone please tell me How to open "Save as dialog box " in mobile . i am using XHTML ( not WAP ) with...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.