require_once "Mail.php";
$host = 'host name of smtp for local system localhost is used';
$recipients = 'email addresses of all to, cc & bcc recipients';
$headers = array ('From' => 'sender',
'To' => 'emails adresses for to field',
'Bcc' => '',
'Subject' => 'email subject',
'Reply-To' => '',
'MIME-Version' => '1.0',
'Content-Type' => 'text/html; charset=UTF-8',
'Content-Transfer-Encoding' => '8bit',
'X-Mailer' => 'PHP/'.phpversion()
);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => 25,
'auth' => FALSE ));
$mail = $smtp->send($recipients, $headers, $message);
if (PEAR::isError($mail)) {
return $mail->getMessage();
} else {
return true;
}
No comments:
Post a Comment