EchoFool Posted May 11, 2009 Share Posted May 11, 2009 I keep get a mail function error related to my server but do not know what i have to do to solve the problem.. this is my error: 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 login.php on line 401 Script: <?php $subject = "Login Infomation Desk"; $headers = 'From: [email protected]' . "\r\n" . 'Reply To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message = "A username ".$Username." has requested help !\r\n\r\n"; $message = $message. "Their message is: \r\n".$Message."\r\n\r\n"; $message = $message. "Username is: ".$Username."\r\n"; $message = $message. "Email is: ".$Email; mail($Email, $subject, $message, $headers); ?> What i done wrong? (also i blanked out my domain email to avoid spam attacks)... hope you can help Link to comment https://forums.phpfreaks.com/topic/157643-solved-mail-function-help/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2009 Share Posted May 11, 2009 Do you have a mail server at "localhost" listening to TCP/IP port 25? What is the relation ship of your mail server to your web server? Do you know the DNS name or IP address of the mail server you are attempting to use? Link to comment https://forums.phpfreaks.com/topic/157643-solved-mail-function-help/#findComment-831278 Share on other sites More sharing options...
EchoFool Posted May 11, 2009 Author Share Posted May 11, 2009 Hmm i think ill speak with my server hosts for this sounds like i need to sort something out on server settings than my php code right? Link to comment https://forums.phpfreaks.com/topic/157643-solved-mail-function-help/#findComment-831284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.