Warning: 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 D:\hshome\nextrex\grafxdesigns.net\p_sendmail.php on line 49
I have error message when i trying to call mail(…) function in my php script. The error look like this:
Warning: 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 D:\hshome.…\index.php on line 303
Please specify your mail server instead of “localhost”
Your mail server would be - mail.yourdomain.com (replace yourdomain.com with your actual domain)
hey i have a simillar porblem too…i am running easyphp i got from some site and when i run the mailing script it say’s…
i am running it from my compute (the server @ localhost)
Warning 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 cprogram filesserver stuffeasyphp1-7wwwindex.php on line 68..
Warning 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:\Program Files\server stuff\EasyPHP1-7\www\index.php on line 68..
I get this message when I try to submit a form using php - I’ve got easy php installed (with apache and mysql) and the SMTP and smtp_port settings are correct. I don’t have a mail server on my machine. Where am I going wrong? Thanks for any help!
Warning: mail(): Failed to connect to mailserver at “mail.btinternet.com” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in c:\easyphp1-7\www\feedback1.php on line 12
<?php
ini_set("SMTP","mail.domain.com");
ini_set("sendmail_from","[email protected]");
if (mail("[email protected]","This is a test","This is the body","From: [email][email protected][/email]\r\nContent-type: text/plain\r\n\r\n"))
{
print "Success";
}
else
{
print "Failed";
}
?>
They require you to specify the SMTP server AND a valid From address for the domain, and the ‘From:’ setting in the header isn’t good enough. You have to use ini_set() for both.