PHP mail script

<?php
include("Mail.php");

/* mail setup recipients, subject etc */
$recipients = "testmail4us@gmail.com";
$headers["From"] = "test@inibayiku.com";
$headers["Return-Path"] = "test@inibayiku.com";
$headers["To"] = "testmail4us@gmail.com";
$headers["Subject"] = "THis is a Test Mail via SMTP AUTH";
$mailmsg = "THis is a Test Mail via SMTP AUTH";

/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "inibayiku.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "test@inibayiku.com";
$smtpinfo["password"] = "test123";

/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);

/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
echo "Mail successfully sent"
?>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s