Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() [duplicate]

Tags:

php

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()

like image 388
Ivan Reuben Ramos Muit Avatar asked Jan 04 '11 07:01

Ivan Reuben Ramos Muit


People also ask

How do I fix failed to connect to mailserver at localhost port 25?

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.

How do I connect to mailserver?

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.


1 Answers

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

like image 114
Programmer Avatar answered Sep 21 '22 08:09

Programmer