Jump to content

mail() function does not work, please help


ice52us

Recommended Posts

I have Windows XP.

I have Apache 2.2.11

I have PHP 5.2.9

 

In my code i am using the function mail() in the following manner:

<?php
$to = '[email protected]';
$subject = 'Abduction Report';
$msg = 'Test Mesage';
$email = '[email protected]';
mail($to, $subject, $msg, 'From:' . $email);
?>

There are no errors and no results. WHY??!?!??!?!?!

I don't know what I'm doing wrong.

 

After looking on forums for a while, I found and tried this piece of code:

 
if (mail($to, $subject, $msg)) {
echo 'Mail Sent';
} else {
echo 'Mail NOT Sent';
}

 

I'm not sure what it means, but the page countinuously says: Mail NOT Sent.

Please tell me how to correct my mistakes.


Link to comment
https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/
Share on other sites

Ok I downloaded "Free SMTP Server" program. When I run it, it says

Waiting for connection on port #25; Using DNS Server 88.828.838.334

When I try to submit the form once more from localhost://report.php, it still says Mail NOT Sent. When I upload the file to online web hosting, it says Mail Sent, but I never recieve any mail.

I'm really stuck, please help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.