PHDEmail SMTP and POP3 COM Component PHDEmail  Email COM Component
for Windows 98, Me, NT 4, 2000 and XP

"Keep in touch... automatically"

Product information
Installation instructions
Component registration
PHDEmailTest C++ example
Version info Known bugs

SMTP Object Interface
POP3 Object Interface

Email sales and support

Use the PHDSMTP object to send emails from an ASP script Use the PHDEMail SMTP object to send email messages.
USe the PHDPOP3 object to read emails Use the PHDEmail POP3 object to read email messages from a mailbox.
Easy to use Use from ASP, Dynamic-CD or any other COM container.
Freeware development kit now available Download the freeware Development Kit under licence.

Last modified: 10 January 2003. Read me
Freeware version: 2.0.1
Retail version: 2.1.0

Email sales for details of how to purchase the retail version for USD75/GBP50/EUR75.

© Copyright 1996,2001,2003 PHD Computer Consultants Ltd


  • SMTP object
  • Sends emails
  • Simple and advanced commands
  • Uses 8-bit or Quoted-Printable encodings
  • Does not send file attachments
  • POP3 object
  • Reads emails
  • Full repertoire of commands
  • Decodes Quoted-Printable
  • Does not read file attachments
  • General
  • Freeware licence
  • US$75 retail licence
  • Full examples provided
  • For Windows 98, Me, NT 4, 2000 and XP
  • Does not work with web based email systems


Product Information

PHDEmail is Windows COM component that lets you send and receive email messages.  It contains two interfaces: PHDSMTP and PHDPOP3.

PHDSMTP lets you send email messages using the standard net SMTP protocol.
Most people will use PHDSMTP to send email messages from server ASP code on a web site or a CD running Dynamic-CD.
PHDSMTP is very easy to use from an .ASP script.  Simply set various properties and then call the SendMail() method to send the message.  If you want, there are several advanced commands that let you have control of the interactions with your SMTP server.

PHDPOP3 lets you read email messages using the standard net POP3 protocol.
Most people will use PHDPOP3 in a client application that needs to read emails.
You use PHDPOP3 by getting it to connect to your POP3 server.  Once the username and password have been verified, you can issue various commands to the server before quitting.  There are commands to list all the available messages, and retrieve or delete individual messages.

Installation:
Examples:
  • The PHDSMTP page contains ASP script examples showing how to send messages.
  • The PHDEmailTest C++ example shows how to read messages using PHDPOP3, as well as send messages using PHDSMTP - source is included.
Limitations:
  • PHDEmail only supports a basic set of encodings for message bodies: 8-bit or Quoted-Printable.
  • PHDEmail cannot access web-based email systems.
  • PHDEmail does not support file attachments.
  • PHDEmail cannot send to newsgroups.
Licensing:
  • Use the freeware version as much as you want, as long as it is not in another non-free email product.
  • Use PHDEmail at your own risk.  If you like the freeware version, send us an email!
  • See the licence for full details.
  • If you want extra features added, tell us and we can make an enhanced retail version.



Installation instructions

The PHDEmail development kit is supplied as an executable, named email200.exe (or similar).  Run email200.exe to install the PHDEmail development kit.  You can uninstall the development kit using Add/Remove Programs in the Control Panel.

The installation program automatically registers the PHDEmail component - see below for details.

To view this documentation select "Start+Programs+PHDEmail+PHDEmail documentation".

Try out the PHDEmailTest example by selecting "Start+Programs+PHDEmail+PHDEmailTest example".  You must be online for PHDEmailTest to work, ie able to talk to your SMTP and POP3 servers.  Type in your server details and try to send yourself an email.

The development kit contains two files that you may find useful.  They are both in the installation directory, ie C:\Program Files\PHD\PHDEmail\ by default.



Component Registration

You must register the PHDEmail component runtime PHDEmail.dll on each computer where you want to use it.

Check the latest PHDEMail licence to see how many computers you are allowed to use PHDEMail on.

regsvr32

Normally you should register PHDEMail using the regsvr32 tool in your Windows System or System32 directory.  This can be done at a Windows DOS prompt or using "Start+Run".  Pass the filename or full path of PHDEmail.dll as a parameter to regsvr32, eg:
regsvr32 PHDEmail.dll
or
C:\Windows\System32\regsvr32 "C:\Program Files\PHD\PHDEmail\PHDEmail.dll"
Normally regsvr32 displays a message box confirming that the component has been registered.  Using parameter /s registers without a message box.  Parameter /u unregisters the component.

PHDregsvr32

The supplied program PHDregsvr32 should be identical to regsvr32PHDregsvr32 can be found in the installation directory, ie C:\Program Files\PHD\PHDEmail\ by default.  You can use PHDregsvr32 to install PHDEmail on other computers.

Development Kit

The PHDEmail development kit automatically uses PHDregsvr32 to register the PHDEmail component (without a message box).

Server use

If you want to run PHDEmail on your web server, then the PHDEmail component has to be registered on the server computer.  Some webmasters may be reluctant to install new components.  Have them contact us for assurance.  The PHDEmail.dll component is signed by "PHD Computer Consultants Ltd" with an Authenticode signature issued by "Thawte Server CA".

Dynamic-CD use

If you want to use PHDEmail on CDs created by PHD's Dynamic-CD software, then you have to get Dynamic-CD to register PHDEmail when it is run.  See the Dynamic-CD documentation for details of how to do this.


PHDEmailTest: Example C++ program

The development kit includes an example Visual C++ program PHDEMailTest that shows how to access the PHDEmail component from C++.  This screenshot shows PHDEMailTest displaying its SMTP tab, having just sent an email successfully.  See the POP3 example for a screenshot and details of PHDEMailTest reading emails.

This example was made using Visual C++ 6.  A new MFC EXE Dialog project was made, with Automation and ActiveX control support.

To be able to use PHDEMail, the crucial step is to import the PHDEmail type library to make the SMTP and POP3 objects available as standard C++ classes called IPHDSMTP and IPHDPOP3.

Start the ClassWizard (Ctrl+W).  In the Automation tab, select Add Class... From a type library... You can import directly from the PHDEmail.tlb type library or from the Component itself, PHDEmail.dll.  Import both IPHDSMTP and IPHDPOP3.  I used the suggested filenames of PHDEmail.h and PHDEmail.cpp for the class definition.

You can then use code like the following to access the PHDEMail component PHDSMTP object.  Note the prefixes Get... and Set... in the property access method names.

IPHDSMTP smtp;
COleException *e = new COleException;
if( !smtp.CreateDispatch( _T("PHDEmail.PHDSMTP"),e))
{
    e->Delete();
    AfxMessageBox(_T("Could not create PHDSMTP object"));
    return;
}
e->Delete();

smtp.SetRemoteHostName(m_RemoteHost);
smtp.SetSender(m_Sender);
smtp.SetRecipient(m_To);
smtp.SetCc(m_CC);
smtp.SetBcc(m_BCC);
smtp.SetMessageSubject(m_Subject);
smtp.SetMessageBody(m_Body);
smtp.SetForceQuotedPrintable(m_ForceQP);

long rv = smtp.SendMail();

CString Results;
if( rv==0)
    Results.Format(_T("Email sent OK.\r\nResponse: %s"), smtp.GetResponse());
else
    Results.Format(_T("Sendmail returned %d.\r\nErrorMsg: %s\r\nResponse: %s"),
        rv, smtp.GetErrorMsg(), smtp.GetResponse());
m_ResultsCtrl.SetWindowText(Results);

If the PHDEmail component is not registered then the program reports that it could not create the PHDSMTP object.



Version Information

PHDEmail retail COM Component

2.1.0 January 10, 2003 Retail version removes SMTP send appended text

PHDEmail freeware COM Component

2.0.1 December 4, 2001 Fixed bug: Finds POP3 message subject etc even if no space after colon in header
2.0.0 July 19, 2001 COM component version released
1.4 June 1996 Return values correctly returned, and WSAError fired correctly.
SocketClosed fired recursive check.
SMTP MultiConnectMsgs property added; implemented in ConnectToSMTPServer.
1.3 1996 OLE Control: First major release.

PHDEmailTest

1.0.0 July 20, 2001 First release

PHDregsvr32

July 19, 2001 Release


Known bugs



Other great PHD products
PHD Computer Consultants Ltd makes no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.  PHD shall not be liable for any damages suffered by a user as a result of using, modifying or distributing the software or its derivatives.