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... Quote 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 Quote 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 = "zoid_active_core@yahoo.com"; $message = "this is a test"; $subject = "mail testing"; if(mail($to,$subject,$message,"From: zoid_active_core@yahoo.com")) 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" Quote 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); Quote 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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/84845-solved-mail-in-php/#findComment-433178 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.