473,387 Members | 1,724 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,387 software developers and data experts.

Open default e-mail client with attachments.

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
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco
Nov 16 '05 #1
3 18200
Gama,

Why not query the user the address they want to send it to, and then use
the SmtpMail class?

If the email applications support MAPI, then you can probably access any
of them through that interface. However, it might require a good deal of
calls through either COM interop on your part, or the P/Invoke layer to
access the API.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Gama Franco" <Ga*********@clix.pt> wrote in message
news:79*************************@posting.google.co m...
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
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco

Nov 16 '05 #2
Hi Nicholas,

Thank you very much for the tip.

I've developed the code and my application can already open the
Outlook window with the attachment on it. The stupid thing is that, in
order to send the e-mail I need to press the Alt+s keys, since the
send button does nothing.

I'm using Outlook 2003, is it a bug or am I missing something?

Best regards,
Gama Franco

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:<uJ*************@TK2MSFTNGP15.phx.gbl>...
Gama,

Why not query the user the address they want to send it to, and then use
the SmtpMail class?

If the email applications support MAPI, then you can probably access any
of them through that interface. However, it might require a good deal of
calls through either COM interop on your part, or the P/Invoke layer to
access the API.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Gama Franco" <Ga*********@clix.pt> wrote in message
news:79*************************@posting.google.co m...
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
user may not be using Outlook as his default e-mail client?

Best regards,
Gama Franco

Nov 16 '05 #3
hi gama i was trying below code. it works fine. i was trying to attach
files but it is not attached. so if any suggestion then pls reply me on
my below email address.
thanks in advance
john
my email address = te*********@rediffmail.com

----------------------------code----------------------------
Mystring.Append("mailto:");
Mystring.Append("&Subject=Finance profit and loss&body=this is test
body");
Mystring.Append("&attach=c:\\test\\test.txt");
Process myProcess = new Process();
myProcess.StartInfo.FileName = Mystring.ToString();
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.Start();
myProcess.Dispose();
*/

Nov 16 '05 #4

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

Similar topics

3
by: Jofio | last post by:
Hello, I am a newbie in PHP and I am enthusiastically trying out things. I've just replaced my index.html ( file with index.php
1
by: Gregor Leban | last post by:
Hi, Our team is working on a data mining software written in python that will run on windows, linux and mac platforms. When clicking on one of the menu items, we would like to open the default...
9
by: Yann.K | last post by:
Hello. I would like to do a hypertext link on a GUI, which launch a per default mail user agent (with the "to" header documented). To launch an url in a web browser i use webbrowser.open(url)....
18
by: Dan Cernat | last post by:
Hi there, A few threads I had a little chat about default values. I am starting this thread because I want to hear more opinions about the default values of function parameters. Some say they...
8
by: cody | last post by:
Why doesn't C# allow default parameters for methods? An argument against I hear often is that the default parameters would have to be hardbaken into the assembly, but why? The Jit can take care of...
1
by: mark2802 | last post by:
Im using the CommonDialog activeX control to select multiple file names. However I would like to be able to control using code the resulting view of the files as you can do in realtime using the view...
4
by: ceolino | last post by:
Hi all, how can I use menu object to open a new window instead of postback to the same page where the menu is? What I'd like to do is like invoking "window.open()" (javascript) from a menu item. ...
8
by: T. Crane | last post by:
Hi, How is the default path chosen in this instance: myFile = file('test.txt','w') Here I'm opening/creating a file but I have not specified the exact path, so how does Python determine...
0
by: namrataa | last post by:
Cannot Open default database. Invalid login for \ -------------------------------------------------------------------------------- Hi, I have written services in WCF using C# and SQL Server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.