Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Sending Mial via Sendmail

Code Wizard, 12-30-2006

This script uses pipes via Linux, FreeBSD, etc. to send mail useing /usr/sbin/sendmail/ instead of the internal php mail() function.

<?

// gotten from PHP.net
// VERY USEFUL!
// sends mail via sendmail

$sendmailLocale = "/usr/sbin/sendmail -t -i";
$mailerFrom = "andrew@evilwalrus.com";

$mailer = popen($sendmailLocale,"w");
fwrite ($mailer,"Subject: $subject
From: $mailerFrom
To: $to

$body");
pclose($mailer);

?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions