PHP mail() problems
Posted: Fri Aug 07, 2009 12:42 pm
Hey, me again with another newbie question.
For some reason this isn't working:
The $value that I am passing to the fuction is an array with elements like username, password, email and so on. For some reason no matter what I try, it always does the Else branch of my if statement.
For some reason this isn't working:
Code: Select all
function mail_to($value)
{
$email = $value['mail'];
$subject = 'Account Registration';
$message = "Your Username is: ".$value['username'];
$headers = 'From: place@stuff.com' . "\r\n" .
'Reply-To: place@stuff.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if (mail($email, $subject, $message, $headers))
{
echo "User information successfully sent to ".$email."";
}
else
{
echo "Email undeliverable.";
}
}