Email tips for PHP Pear

Tuesday, May 19, 2009 Posted by Md. Monjurul Hasan
Email facility is required for almost every application. Hence these tips are helpful.

1. For datetime in proper format,
$headers["Date"] = date("r");

2. For both HTML and text mail,
 $headers["Content-Type"] = "multipart/alternative";

3. For sending mail with SMTP Authentication,
$mail = Mail::factory(
"smtp",
array ('host' => $host,
'auth' => 'true',
'username' => $username,
'password' => $password)
);


A quick helpful tutorial: http://email.about.com/od/emailprogrammingtips/qt/et073006.htm
Labels: , ,