SendEmail class library for Visual FoxPro 8.0
September 2004, News2News



The library implements sending email messages through SMTP and Webmail (Hotmail and MSN) servers. The attached source code is preliminary version distributed for testing purposes only.

Minimal system requirements
  • Windows XP/2000
  • Visual FoxPro 8.0

  • Implemented functionality
    Email headers, multi-part messages and file attachments; multiple recipients, base64 and quoted-printable encoding...more...

    Not implemented functionality
    SMTP authentication...more...


    Classes included
    The library contains two main classes:
    Other classes:


    Sending email message, steps:
    - create message object (MSG)

    - fill message object with data:
    - create mailgate object (MAILGATE_DUMB, MAILGATE_SMTP, MAILGATE_HOTMAIL)

    - establish connection with a mail server in either way:
    - pass the message object to sendmessage method of the mailgate


    Mailgates
    The mailgate implements connection to mail server -- SMTP or Hotmail/MSN. All three mailgates inherit from the MAILGATE class. Instantiating MAILGATE directly is not required.

    MAILGATE_DUMB
    This mailgate is for testing purposes only and is not connected to any server. After running its sendmessage method retrieve would-be sent message from its msgbuffer property.

    MAILGATE_SMTP
    To use this mailgate pass valid SMTP server name either to CREATEOBJECT or to connect method of MAILGATE_SMTP object. Very often SMTP servers do not require authorization, so a server name is enough if you connect from proper ip address.

    MAILGATE_HOTMAIL
    To use this mailgate pass valid Hotmail or MSN address and password either to CREATEOBJECT or to connect method of MAILGATE_HOTMAIL object.


    Program files


    Code samples

    test00.prg -- creates three main objects: message, smtp mailgate and hotmail mailgate. Server names and passwords are not required.

    test01.prg -- creates and populates a message object then opens its preview using dumb mailgate. Server names and passwords are not required, the message is not sent to anywhere.

    test02.prg -- sends plain-text message with attached file using SMTP server. Provide valid content for smtp server, sender, recipient(s), subject, body, file(s) to be attached. Properly configured code will actually send the message.

    test03.prg -- sends plain-text message with attached file using Hotmail or MSN server. Provide valid Hotmail/MSN address and password, sender, recipient(s), subject, body, file(s) to be attached. Properly configured code will actually send the message.


    Contact info:

    Anatoliy Mogylevets
    devicecontext@msn.com
    http://www.news2news.com/vfp