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)


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

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 Kb
Download source - 147 Kb


Comments

  • 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??

    Shashi

    Reply
  • Implemention of AUTH LOGIN (or other method)

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

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

    Reply
  • 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?

    Reply
  • 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.

    Reply
  • 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 ?

    Reply
  • 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
    Mandar

    Reply
  • 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 : jc_dupont@ibm.com
    To : jc_dupont@hotmail.com

    and I revieve theses error messages :

    Sender Rejected.

    or


    Could not revieve first line from server.


    Please,can you help me ?
    Thanks.

    Best regards.

    Jean claude Dupont.

    Reply
  • 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.
    thanks
    regards..........

    Reply
  • 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
    thankQ

    Reply
  • 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

    Reply
  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • Wednesday, September 24, 2014 8:00 AM - 9:00 AM PDT According to a recent Forrester Research report, many companies are choosing low-code platforms over traditional programming platforms, due to the speed with which low-code apps can be assembled and tested. With customer-facing applications on the rise, traditional programming platforms simply can't keep up with the "short schedules and rapid change cycles" required to develop these applications. Check out this upcoming webinar and join Clay Richardson from …

  • Live Event Date: September 16, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you starting an on-premise-to-cloud data migration project? Have you thought about how much space you might need for your online platform or how to handle data that might be related to users who no longer exist? If these questions or any other concerns have been plaguing you about your migration project, check out this eSeminar. Join our speakers Betsy Bilhorn, VP, Product Management at Scribe, Mike Virnig, PowerSucess Manager and Michele …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds