Jump to content

[SOLVED] mail() in php


cyber_ghost

Recommended Posts

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

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

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

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.