PHP Salt


A little dash of PHP... my collection of php functions

Version: 2.14.1
Last Build: March 10, 2017 13:28pm (PST)

psMailSimple()
Simple mail wrapper


Description:

Just a simple email function, uses propper email formating of names

Note: this is a wrapper for mail()


Usage:

psMailSimple($toEmail, $toName, $fromEmail, $fromName, $subject, $body);


Example:


psMailSimple("sumguy@aol.com", "Sum Guy", "admin@here.com", "The Admin", "Spam", "Stop Spamming us!");




Code:



function psMailSimple($toEmail, $toName, $fromEmail, $fromName, $subject, $body)
{
$headers = "From: $fromName <$fromEmail>\r\n" .
"X-Mailer: psMailSimple (PHP Salt library function)\r\n";
ini_set('sendmail_from', $fromEmail);
mail($toEmail, $subject, $body, $headers); //mail command :)
}


Changlelog:


See Also

And a shot out to:

LinuxSimple - www.linuxsimple.com
PHP - php.net
Fedora Server - getfedora.com
Shameless ads to pay for site