PHP Salt


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

Version: 2.33.2
Last Build: December 29, 2023 20:28pm (PST)

Main Menu

Home

Get PHP Salt


The Functions

array
db
file
graph
html
mail
math
misc
mobile
script
string
system
time
web
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, "-f {$fromEmail}"); //mail command :)
}



Changlelog:


See Also

And a shot out to:

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