services


gallery


tutorials


process


contact


links

Gallery:  ColdFusion ASP PHP Shootout

ColdFusion

ASP

PHP

Sending and Receiving Email

ColdFusion

In order to send email with ColdFusion you will first need to provide information to ColdFusion that will allow it to find your SMTP server.

Use the CFMAIL tag to send email. It is simple and straight forward and provides plenty of capability including multiple recipients and MIME attachments, and it also has the ability to work interactively with database query results in much the same way that the CFOUTPUT tag does.

The CFPOP tag provides all the functionality needed to acces the contents of an inbox on a Post Office Protocol (POP) server. You can obtain a complete or partial list of message headers, obtain the header and contents of one or more messages, and download and save attachments from messages.



ASP

You can use CDO (Collaborative Data Objects) for creating email messages, but only if you are using NT Server and IIS as neither of the CDO collections will work with Personal Web Server. Alternately, you can purchase server components that are designed to easily handle all kinds of email requirements.

There are two different sets of CDO objects:

  • CDO for NT Server is the simpler of the two. It is shipped with IIS 4 and can be run against the SMTP Server component of IIS 4. CDONTS provides simple email sending and receiving capabilities. Here is an article that explains its use. http://www.aspalliance.com/wiseasp/
    aboutemail.asp


  • CDO for Exchange is more complex and supports the full range of Microsoft Exchange capabilities.



PHP

You use the built-in mail() command to send simple text messages. Mail() relies on the local mail system to deliver emails. If your program cannot rely on the local mail system, then rather then using mail() you’ll have to access an SMTP server directly. This isn’t simple. Consider obtaining some ready-made source code from a book on PHP that includes a CD, or from the web.

The ability to attach something such as a Wordprocessor document to an email requires the use of MIME, the Multipurpose Internet Mail Extensions. You can do it with PHP but it’s not pretty. Look for some ready-made source code.

For receiving email, the standard IMAP protocol is well supported by PHP.



Copyright © 2005 Cyberglitz

email: info@cyberglitz.com