PHP Salt


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

Version: 2.24.1
Last Build: May 09, 2019 21:57pm (PST)

Main Menu

Home

Get PHP Salt


The Functions

array
db
file
graph
html
mail
math
misc
mobile
script
string
system
time
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="")
{
$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:

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