Simple Email Client v1.0
Environment: VC6 SP5, Windows 2000 (used to work VC6 SP3, NT 4.0/Win95/Win98)
OVERVIEW
This ATL COM component provides very simple Internet email functionality (SMTP).
FEATURES
- implements the basics of SMTP, as defined in RFC821 and RFC822,
- sends plain text email: no attachements, no MIME encoding,
- supports multiple recipients (separate email addresses with commas ','),
- supports multiple email servers (try next server if email cannot be delivered to a server),
- provides automatic detection of SMTP server (resolve MX record in the DNS, using COMponent SimpleDNSResolver)
- provides extended error information (ISupportErrorInfo and IErrorInfo are implemented),
- is safe for scripting (IObjectSafety is implemented),
- provides very small executable: 44 Ko (MinSize) to 152 Ko (MinDependency)
- requires no Graphical User Interface: the component can be used in non-GUI applications, like a Windows NT Service.
- runs on Windows 2000 (originally on NT 4.0, Windows 95 and Windows 98)
- compiles with VC++ 6.0 SP3
USAGE
To use this component:- create an instance of the component,
- call method SendEmail from interface ISimpleEmailClientX,
- handle errors (try/catch in C++)
SAMPLE CODE (VC++)
#import "SimpleEmailClient.dll" no_namespace
ISimpleEmailClientXPtr pSimpleEmailClientX;
HRESULT hResult = CoInitialize(NULL);
hResult = pSimpleEmailClientX.CreateInstance("Emmanuel.SimpleEmailClientX.1");
hResult = pSimpleEmailClientX->SendEmail(_bstr_t("me@mydomain.com"),
_bstr_t("you@yourdomain.com"),
_bstr_t("My Subject"),
_bstr_t("My Text..."),
_bstr_t("myserver.domain.com"));
CoUninitialize();
Please refer to the demo project for a full example. Note that you should extract the demo project underneath the component project:
-
SimpleEmailClient\
-
TestSimpleEmailClient\
SAMPLE CODE (VBScript)
Dim oSMTP
Set oSMTP = CreateObject("Emmanuel.SimpleEmailClientX.1")
oSMTP.SendEmail "me@mydomain.com", "you@yourdomain.com",
"My Subject", "My Text...", "myserver.domain.com"
Please refer to the test HTML file "TestSimpleEmailClient.htm" for a full VBSsript example (see GUI below)
IMPLEMENTATION
This component relies on two MFC-related C++ class:- CSimpleSocket: an extension of MFC class CSocket providing text and timer features
- CSimpleSMTPClient: a C++ class implementing a SMTP client.
You can integrate these classes in your application if you don't want to use the component.
If the COMponent "Emmanuel.SimpleDNSClient" is installed on your machine, it will be used to find the name of you SMTP server(s) as registered in the DNS. You will not need to provide a SMTP name as the 5th parameter of method SendEmail (just put an empty string). Please refer to the SimpleDNSClient documentation (www.kartmann.org) for details.
TO DO LIST
- Support attachments
- Support binary data (MIME encoding)
- Support additional SMTP headers (Reply-To, Cc, Bcc, etc...)
- Support ESMTP
Downloads
Download demo project - 122 KbDownload source - 147 Kb

>
Comments
Excellent Work, What Abt attachments?
Posted by Legacy on 09/29/2003 12:00amOriginally posted by: shashi
ReplyImplemention of AUTH LOGIN (or other method)
Posted by Legacy on 09/23/2003 12:00amOriginally posted by: Alain
Hi,
There a long time you have not improve your code, so i don't know if you developp this project again.
Your dll is pretty simple for using that s why i'll like to have new feature. To send mail by yahoo's STMP (for example), we need to have an identification.
Could you put this feature in a new rlz ? I tested to put it myself but my knowledges in C++ seems to be poor and the AUTH Method too...
What i know when a SMPT require an identification :
(for AUTH LOGIN method)
send : AUTH LOGIN
recv : 334 VXNlcm5hbWU6
send : identifiant in base64
recv : 334 UGFzc3dvcmQ6
send : mdp in base64
recv : 235 ok, go ahead (#2.0.0)
And after the server is ok to received the email as usual.
I hope you could make this. Or perhaps give me a link for another dll who know AUTH Method.
Thank You
ReplyAlain
How can I browse email like OutLook express
Posted by Legacy on 01/15/2003 12:00amOriginally posted by: Gray
Replysource code
Posted by Legacy on 05/21/2002 12:00amOriginally posted by: sarvesh
I developed LIBRARY MANAGEMENT SOFTWARE Project in Visual Basic and Back end is Microsoft Access.My problem is suppose if employee doesn't return book within the mentioned date then a message is sent automatically to respective employee that your book return date is exceeded the mentioned date and also print the fine until he return book back to the library.
ReplyHow to add firewall to this SMTP
Posted by Legacy on 01/22/2002 12:00amOriginally posted by: sagrawal
how can one integerate firewall in this smtp ?
Replyemail not sent
Posted by Legacy on 01/18/2002 12:00amOriginally posted by: m
Hi Emmanual
ReplyI added the code snippet that you have given to my project in VC++ on windows 2000, but it does not send e-mail, it did not give me any error but it did not send the e-mail either, since I do not get any kind of error I cannot debug it.But it does send e-mail thru' your program, I can;t understand why it cannot through mine, I actually copied your dll into my project and registered it there but still it does not work.I have put the library in the vc98/lib folder as usual.
could you please help me with this
Mandar
Error : Could not revieve first line from server. Sender Rejected.
Posted by Legacy on 11/28/2001 12:00amOriginally posted by: Dupont Jean Claude
Replyhow to add functionality to send attachment in this code??????
Posted by Legacy on 11/08/2001 12:00amOriginally posted by: priyanka
dear sir.........
Replygr8 work, but i want to send attachment directly thru SMTP server. can u guide me to do that.
thanks
regards..........
I want a smtp server code for mail server
Posted by Legacy on 10/30/2001 12:00amOriginally posted by: ravi kumar
Hi this is ravi,
ReplyCan u help me in getting the smtp code for mail server
thankQ
Application should have a success notification.
Posted by Legacy on 10/24/2001 12:00amOriginally posted by: Charles Han
pop up a success message and close after message being sent successfully
ReplyLoading, Please Wait ...