ROCKINDANO Posted August 28, 2009 Share Posted August 28, 2009 for the past few days i have been working with a mail form, which by the way i can't seem to set it going. yesterday after long hrs of working on it, i was successful. i received a test email from my email form. made a change in the code and the form was not working again. this is what i have in my php.ini file for the SMTP set up: [mail function] ; For Win32 only. SMTP = mail.domainhere.local smtp_port = 25 and i have a SMTP installed in my test machine and in our in house mail server. made sure the services are running. now this is what i have in my php code: <?php ini_set("display_errors", "1"); error_reporting(E_ALL); //Customer Name $custname = $_REQUEST['custname'] ; //Customers Email $email = $_REQUEST['email'] ; //Customers Feedback $message = $_REQUEST['feedback'] ; //Subject $subject = "Feed Back from website"; //You (to address) $to = "[email protected]"; $headers = "From: $email"; ini_set("SMTP","mail.domain.local"); $sent = mail($to, $subject, $message, $headers); if($sent) {print "W000t! It works!"; } else {print "Damn! It dont work"; } the only thing that i get is a warning that says this. Warning: mail() [function.mail]: Failed to connect to mailserver at "mail.domain.local" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\processfeedback.php on line 52 Damn! It dont work any help!? Link to comment https://forums.phpfreaks.com/topic/172271-solved-mail/ Share on other sites More sharing options...
lynxus Posted August 28, 2009 Share Posted August 28, 2009 Change your SMTP servers address from a fqdn to an IP. If its a local server change to 127.0.0.1 If its somewhere else, get the ip of it. I recon that .local at the end may be causing issues. Link to comment https://forums.phpfreaks.com/topic/172271-solved-mail/#findComment-908306 Share on other sites More sharing options...
ROCKINDANO Posted August 28, 2009 Author Share Posted August 28, 2009 k thanks let me try that, and i'll be back. Link to comment https://forums.phpfreaks.com/topic/172271-solved-mail/#findComment-908309 Share on other sites More sharing options...
lynxus Posted August 28, 2009 Share Posted August 28, 2009 ie: ini_set("SMTP","127.0.0.1"); Link to comment https://forums.phpfreaks.com/topic/172271-solved-mail/#findComment-908313 Share on other sites More sharing options...
ROCKINDANO Posted August 28, 2009 Author Share Posted August 28, 2009 well changed the domain in ini_set("SMTP", "mail.domain.local") to another domain that we also use and it works. Yea......... Thanks lynxus. Link to comment https://forums.phpfreaks.com/topic/172271-solved-mail/#findComment-908324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.