Thursday, 23 October 2008

SendMail with PHP

Heres a snippit ive used to send mail with PHP. Your mail server must be configured with your php installation, then your all set.

$EmailSubject = "Hello World Test";
$EmailFrom = "";
$EmailTo = "";
$Message = "Hi, I'm sending this quick E-Mail to test my PHP Mail functionality! Thanks!";
$result = mail($EmailTo, $EmailSubject, $Message, "From: $EmailFrom");
if ($result == 1)
     echo "Mail sent sucessfully!";
     echo "There was an error sending the mail.";

No comments: