Wednesday, December 29, 2010

php note - sending email from server

<?php
$to = "
aaa@bbb.com";
$subject = "email sent with php";
$body = "sending email from server using php script.";
$headers = "From:
xxx@yyy.com\n";
# error checking
if(mail($to,$subject,$body,$headers)){
    echo "email was sent to $to with the subject: $subject";
}
else{
    echo "there was a problem sending the email";
}
?>

No comments:

Post a Comment