By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,402 Members | 1,117 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,402 IT Pros & Developers. It's quick & easy.

Open default e-mail client with attachments.

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.