Click to See Complete Forum and Search --> : How can I pop up the default mail client to send an email with a document attached.


April 29th, 1999, 07:48 AM
How can I pop up the default mail client to send an email with a document attached (how Windows Explorer - send to Mail Recipient).
I have VC++5 Enterprise version.

Michael Decker
April 29th, 1999, 08:18 AM
See the "MAPI Support in MFC" topic in the DevStudio help.

William Walseth
April 29th, 1999, 08:39 AM
First, since you are using MFC, look at the MAPI class created by Rob Manderson on CodeGuru http://www.codeguru.com/internet/imapi.shtml. If your program cannot assume that MAPI is avalable, read on...

I don't think that there is a "default" e-mail client you could load, or a standard COM (or other) interface common to all e-mail client programs. My advice is to use SMTP (Simple Mail Transport Protocol). An advantage of SMTP is that your client need not even have an e-mail account, or a e-mail client installed.

At a high level, an SMTP would work like this. When your program needs to send an e-mail, you would create a socket, connect to the server, then perform reads and writes that make up the actual message. For the low-down on SMTP check out http://www.alcpress.com/rfc/mail/std10.htm. Of course CodeGuru also offers some help with SMTP, check-out http://www.codeguru.com/internet/index.shtml.

You may contact me directly for some sample Visual C++ 5.0 code to send an e-mail via SMTP.

William A. Walseth

Michael Decker
April 29th, 1999, 08:51 AM
Actually, there is a default simple mapi client. Its not automatically set. You have to set it within the mail tool that you'd like to be your default.

January 4th, 2000, 05:48 AM
Sir ,
Kindly send some sample source code of e-mail using SMTP

Anil .S
anils@multitech.co.in