Simple Email Client v1.0

Environment: VC6 SP5, Windows 2000 (used to work VC6 SP3, NT 4.0/Win95/Win98)


This ATL COM component provides very simple Internet email functionality (SMTP).


  • 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


To use this component:
  • create an instance of the component,
  • call method SendEmail from interface ISimpleEmailClientX,
  • handle errors (try/catch in C++)


    #import "SimpleEmailClient.dll" no_namespace

    ISimpleEmailClientXPtr pSimpleEmailClientX;

    HRESULT hResult = CoInitialize(NULL); 
    hResult = pSimpleEmailClientX.CreateInstance("Emmanuel.SimpleEmailClientX.1");

    hResult = pSimpleEmailClientX->SendEmail(_bstr_t(""), 
                                             _bstr_t("My Subject"), 
                                             _bstr_t("My Text..."), 


Please refer to the demo project for a full example. Note that you should extract the demo project underneath the component project:



  Dim oSMTP

  Set oSMTP = CreateObject("Emmanuel.SimpleEmailClientX.1")

  oSMTP.SendEmail "", "", 
                  "My Subject", "My Text...", ""

Please refer to the test HTML file "TestSimpleEmailClient.htm" for a full VBSsript example (see GUI below)

Using the SimpleEmailClient in Internet Explorer>
Click here for larger image


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 ( for details.


  • Support attachments
  • Support binary data (MIME encoding)
  • Support additional SMTP headers (Reply-To, Cc, Bcc, etc...)
  • Support ESMTP


Download demo project - 122 Kb
Download source - 147 Kb


  • Excellent Work, What Abt attachments?

    Posted by Legacy on 09/29/2003 12:00am

    Originally posted by: shashi

    Really a wonderful work done! 
    I Need to know how to attach a file with this??


  • Implemention of AUTH LOGIN (or other method)

    Posted by Legacy on 09/23/2003 12:00am

    Originally posted by: Alain


    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

  • How can I browse email like OutLook express

    Posted by Legacy on 01/15/2003 12:00am

    Originally posted by: Gray

    How can I  browse email like OutLook express?
    could you give me a simple example?

  • source code

    Posted by Legacy on 05/21/2002 12:00am

    Originally 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.

  • How to add firewall to this SMTP

    Posted by Legacy on 01/22/2002 12:00am

    Originally posted by: sagrawal

    how can one integerate firewall in this smtp ?

  • email not sent

    Posted by Legacy on 01/18/2002 12:00am

    Originally posted by: m

    Hi Emmanual
    I 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

  • Error : Could not revieve first line from server. Sender Rejected.

    Posted by Legacy on 11/28/2001 12:00am

    Originally posted by: Dupont Jean Claude

    I used your programm, with theses parameters :

    From :
    To :

    and I revieve theses error messages :

    Sender Rejected.


    Could not revieve first line from server.

    Please,can you help me ?

    Best regards.

    Jean claude Dupont.

  • how to add functionality to send attachment in this code??????

    Posted by Legacy on 11/08/2001 12:00am

    Originally posted by: priyanka

    dear sir.........
    gr8 work, but i want to send attachment directly thru SMTP server. can u guide me to do that.

  • I want a smtp server code for mail server

    Posted by Legacy on 10/30/2001 12:00am

    Originally posted by: ravi kumar

    Hi this is ravi,

    Can u help me in getting the smtp code for mail server

  • Application should have a success notification.

    Posted by Legacy on 10/24/2001 12:00am

    Originally posted by: Charles Han

    pop up a success message and close after message being sent successfully

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • U.S. companies are desperately trying to recruit and hire skilled software engineers and developers, but there's simply not enough quality talent to go around. In response, companies often resort to inferior solutions -- hiring substandard developers and engineers, recruiting talent on a part-time or temporary basis, poaching people from competitors, or burdening an already stressed IT staff for more of their labor. Fortunately, there's a better solution. Read this white paper to learn the business value of …

  • On-demand Event Event Date: September 23, 2015 The cloud is not just about a runtime platform for your projects – now, you can do your development in the cloud, too. Check out this webcast to learn how the cloud improves your development experience and team collaboration. Join Dana Singleterry, Principal Product Manager for Oracle Dev Tools, as he discusses how to simplify every aspect of the development lifecycle, including requirements gathering, version management, code reviews, build automation, and …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date