|
PHDEmail |
Email COM Component for Windows 98, Me, NT 4, 2000 and XP "Keep in touch... automatically" |
|
Product information Installation instructions PHDEmailTest C++ example Version info Known bugs |
Email sales for details of how to purchase the retail version for USD75/GBP50/EUR75. © Copyright 1996,2001,2003 PHD Computer Consultants Ltd
|
|
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:
- First install the development kit.
- You must register the PHDEmail runtime on each computer before it can be used.
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.
The PHDEmail development kit is supplied as an executable, namedemail200.exe(or similar). Runemail200.exeto 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.
- The type library file
phdemail.tlbis used in application development. See the C++ example below for more details.- The file
EmailErr.his a C++ header file that lists all the PHDEmail negative error codes.
You must register the PHDEmail component runtimePHDEmail.dllon 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 WindowsSystemorSystem32directory. This can be done at a Windows DOS prompt or using "Start+Run". Pass the filename or full path ofPHDEmail.dllas a parameter to regsvr32, eg:regsvr32 PHDEmail.dll
orC:\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/sregisters without a message box. Parameter/uunregisters the component.
PHDregsvr32
The supplied program PHDregsvr32 should be identical to regsvr32. PHDregsvr32 can be found in the installation directory, ieC:\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. ThePHDEmail.dllcomponent 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.
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.tlbtype library or from the Component itself,PHDEmail.dll. Import both IPHDSMTP and IPHDPOP3. I used the suggested filenames ofPHDEmail.handPHDEmail.cppfor the class definition.You can then use code like the following to access the PHDEMail component PHDSMTP object. Note the prefixes
Get...andSet...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.
| 2.1.0 | January 10, 2003 | Retail version removes SMTP send appended text |
| 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. |
| 1.0.0 | July 20, 2001 | First release |
| July 19, 2001 | Release |
Other great PHD products
|