Possible Duplicate:
Failed to connect to mailserver at “localhost” port 25
I used this one however
$to = "[email protected]";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: [email protected]" . "\r\n" .
"CC: [email protected]";
mail($to,$subject,$txt,$headers);
I have this error which is Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
Error 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 wamp www niroj register php on line 50.
If you're using the web app, go to Create an email server profile using the legacy web app. On the command bar, select Settings > Email > Server profiles. On the command bar, select New server profile. For Email Server Type, select Other (IMAP/POP,SMTP), and then specify a meaningful Name for the profile.
If you are running your application just on localhost and it is not yet live, I believe it is very difficult to send mail using this.
Once you put your application online, I believe that this problem should be automatically solved. By the way,ini_set() helps you to change the values in php.ini during run time.
This is the same question as Failed to connect to mailserver at "localhost" port 25
also check this php mail function not working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With