include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "email addresses of all to, cc & bcc recipients";
$headers["From"] = "sender;
$headers["To"] = "emails adresses for to field";
$headers["Subject"] = "email subject";
$mailmsg = "Html body of mail";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "host name of smtp for local system localhost is used";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "smtpusername";
$smtpinfo["password"] = "smtpPassword";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>
Friday, June 19, 2009
PHP Send Email Using SMTP
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment