Click to See Complete Forum and Search --> : Why Doesn't The Mail Function Work??


SZero
09-01-2007, 02:21 AM
hi every1..

would some1 plz help me out here, i'm using this code to send an e-mail:

$recipient='aaa@hotmail.com';
$subject='hi';
$msg='msg';
$email='sss@hotmail.com';
$mailheaders = "From: \t$email\n";
mail($recipient, $subject, $msg, $mailheaders);

why doesn't it work, no errors show up and nothing is send..

SZero
09-01-2007, 04:02 PM
any1 plz?? it's urgent, i know its right code but wut could be wrong?? i tried it on lycos server didn't work too..

hastx
09-01-2007, 05:22 PM
Just a stab, but try leaving the "\t" out of the header and replace the "\n" with \r\n

SZero
09-01-2007, 05:27 PM
still doesn't work

Yelgnidroc
09-01-2007, 05:46 PM
Could be that your server is not correctly configured to send e-mail.

hastx
09-01-2007, 05:46 PM
see if th server really thinks it was sent.


if (mail($recipient, $subject, $msg, $mailheaders)){
echo "message sent";
}else{
echo "message failed";
}


If the server thinks it was sent. then you may have another problem like spam filter, or blacklist.

You can also try turning on error reporting on the file.

Yelgnidroc
09-01-2007, 06:26 PM
I had an issue with an old host whereby mail() returned true, but this only means that php has done it's bit, not that the mail has actually been despatched by sendmail or whatever.

SZero
09-02-2007, 01:24 AM
see if th server really thinks it was sent.


if (mail($recipient, $subject, $msg, $mailheaders)){
echo "message sent";
}else{
echo "message failed";
}


If the server thinks it was sent. then you may have another problem like spam filter, or blacklist.

You can also try turning on error reporting on the file.

it says message failed :(



Could be that your server is not correctly configured to send e-mail.
how to do that???

hastx
09-03-2007, 08:35 AM
You'll probably need to submit a trouble report. If you dont own the server, you're not going to have access to the configs.