Testing PHP mail

Here is a script you can use to verify php mail is functioning... you need to change the to and from address variables appropriately.

<?php
$to_address="your@email.com";
$from_address="user@server.com";
$body="Test message";
$headers = "From: $from_address \r\n";
$headers.= "Content-Type: text/plain; charset=ISO-8859-1 ";
$headers .= "MIME-Version: 1.0 ";
mail("$to_address", "PHP Mail works", $body, $headers);
?>

Submitted by jkelly on Wed, 2007-06-20 19:18. categories [ | ] login or register to post comments