Php script for mail doens't work anymore

Status
Not open for further replies.

messa

New Member
Messages
12
Reaction score
0
Points
0
Hello,

I use since a few months a contact form made in Flash with a php script to send me mail, now since a couple of days (could be longer) it doesn't work anymore.
When I use this test script, that works fine
<?
mail("emailadres@myprovider.com","test","OK it works");
?>

When I use my script, it doesn't

<?
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))
{
$to = "myemail@myprovider.com";
$subject = stripslashes($HTTP_POST_VARS['sender_subject']);
$body = stripslashes($HTTP_POST_VARS['sender_message']);
$body .= "\n\n---------------------------\n";
$body .= "Mail sent by: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\n";
$header .= "X-Priority: 1";
if(@mail($to, $subject, $body, $header))
{
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error";
}
?>

Ofcourse the email adresse in my script are correct, I just taken them out...
On my local webserver it all works fine...
Can someone help me locate the source of this problem.
something changed on the webservers ?

Thanks for the help

messa
 

smmalis37

New Member
Messages
18
Reaction score
0
Points
1
Are you on advanced php? Beginner doesn't support the mail function. Also, the big if at the beginning should probably have the ors changed to ands. But the big one i think is that $HTTP_POST_VARS needs to be changed to just $_POST. Try those.
 
Status
Not open for further replies.
Top