Question:
PHP Mail() Function Help?
?
2014-04-17 00:20:02 UTC
"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 W:\www\test\test2.php on line 10
Thank you for sending us feedback"

Ok so i did some search on google and its say to change php.ini,set the email to webmaster mail,port and everything,but it is possible if the webmaster mail is gmail?and can explain to me how to change php.ini..Thanks for ur help
Three answers:
TheDot
2014-04-17 02:49:22 UTC
are you developing you php script locally on your machine? its probably wont locally. to change your php.ini file just open it up with a text editor and edit away... PS your php.ini file should be in your webservers root directory.
?
2014-04-17 04:17:51 UTC
PHP mail function did not work on Local Host.. try it on server
anonymous
2014-04-17 01:13:31 UTC
Example of php mail() Function:




// the message

$msg = "First line of text\nSecond line of text";



// use wordwrap() if lines are longer than 70 characters

$msg = wordwrap($msg,70);



// send email

mail("someone@example.com","My subject",$msg);

?>


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...