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 = 'ice52us@yahoo.com';
$subject = 'Abduction Report';
$msg = 'Test Mesage';
$email = 'Someone@yahoo.com';
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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.