ice52us Posted May 3, 2009 Share Posted May 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/ Share on other sites More sharing options...
Daniel0 Posted May 3, 2009 Share Posted May 3, 2009 Make sure you have an MTA installed and configured correctly on your computer. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-824814 Share on other sites More sharing options...
ice52us Posted May 3, 2009 Author Share Posted May 3, 2009 What is MTA, and how do I install it? p.s. thank you for your response. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825042 Share on other sites More sharing options...
Daniel0 Posted May 3, 2009 Share Posted May 3, 2009 MTA means mail transfer agent, and you install it by searching for a such one using Google, downloading it and double clicking on its installer executable. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825046 Share on other sites More sharing options...
ice52us Posted May 3, 2009 Author Share Posted May 3, 2009 Which one would you recommend for my system and my server? There are very many. Also, I have an Opera Mail Client, is that the same thing? Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825161 Share on other sites More sharing options...
ice52us Posted May 3, 2009 Author Share Posted May 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825188 Share on other sites More sharing options...
garethhall Posted May 4, 2009 Share Posted May 4, 2009 Make sure that port 25 is open Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825308 Share on other sites More sharing options...
ice52us Posted May 4, 2009 Author Share Posted May 4, 2009 HOW?!?!?!?! Nobody seems to understand they are talking to a noob here. I don't understand what you mean, please explain thouroughly. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825373 Share on other sites More sharing options...
mapleleaf Posted May 4, 2009 Share Posted May 4, 2009 Use a real email(not a yahoo email) as the FROM and see what happens. Yahoo is probably blocking it. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825375 Share on other sites More sharing options...
ice52us Posted May 4, 2009 Author Share Posted May 4, 2009 It's a no go, still doesn't work, I played with a variety of $to and $emil emails and nothing works... Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825398 Share on other sites More sharing options...
fry2010 Posted May 4, 2009 Share Posted May 4, 2009 You have to use a real from address, and a real to address. It doesnt look like your using a real from: address. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825408 Share on other sites More sharing options...
Daniel0 Posted May 4, 2009 Share Posted May 4, 2009 Nobody seems to understand they are talking to a noob here. Since when did Google block access to noobs? Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825415 Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Nobody seems to understand they are talking to a noob here. Since when did Google block access to noobs? NICE! +10 points to Daniel0. Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-825422 Share on other sites More sharing options...
sunilrxg Posted May 5, 2009 Share Posted May 5, 2009 use the function as below and try mail($to, $subject, $msg, $email); in yahoo i faced same issue.... Quote Link to comment https://forums.phpfreaks.com/topic/156644-mail-function-does-not-work-please-help/#findComment-826437 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.