cyber_ghost Posted January 7, 2008 Share Posted January 7, 2008 its been 2 days of searching the reasons... why does mail() in php cant send email to other web server (e.g. yahoo, gmail, etc), but nobody gives me a details infos.. about this matter......? anyway this is my first time in taking the mail function...... does any body here knows the reasons why does this dump thing happening? im current using xampp, with mercury32 as a mail server.... thank you in advance... Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/ Share on other sites More sharing options...
priti Posted January 7, 2008 Share Posted January 7, 2008 Are you sure your code is sending mail from your side.If yes then first check the junk folders of there email and then let us know how you are sending your mails. regards Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-432543 Share on other sites More sharing options...
cyber_ghost Posted January 7, 2008 Author Share Posted January 7, 2008 ok here is my code: <?php $to = "[email protected]"; $message = "this is a test"; $subject = "mail testing"; if(mail($to,$subject,$message,"From: [email protected]")) echo "sent"; else echo "not sent"; ?> ---- it just display "sent", but when i gonna check my email account....... theres none... the mercury when disabled displayed " Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\fatmalaboo\html\ordering\submitting_order.php on line 20" Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-432546 Share on other sites More sharing options...
adam291086 Posted January 7, 2008 Share Posted January 7, 2008 add this to the top of you script. See if any errors are displayed ini_set ("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-432547 Share on other sites More sharing options...
Cazrin Posted January 7, 2008 Share Posted January 7, 2008 I see you're sending this from your own server on xamp. I'm pretty sure that xamp doesn't include an SMTP server as standard, so make sure you get one installed otherwise it isn't going to work at all. I get this same issue when testing scripts that try send e-mails, but they work fine once they're uploaded to my webspace. Maybe someone can recommend a good SMTP server to try, but I'm sure google will give you some free programs out there. Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-432551 Share on other sites More sharing options...
cyber_ghost Posted January 8, 2008 Author Share Posted January 8, 2008 yes,,, it working......... i downloaded a free smtp server from google.. thank you.. guys... and guys you thank.. hehehehe Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-433178 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.