aarbrouk Posted March 26, 2009 Share Posted March 26, 2009 Greetings all, I am using WAMP as the server to run the php scripts on but this does not seem to work when sending emails. I have read various information about it but don't seem to be getting a clear answer. It seems that WAMP does not come with a mail server. I have downloaded something called KERIO Mail server hoping that this would resolve the problem. This is only a 30 day trial which is not very good. I also can't get this configured and am getting the following 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 C:\wamp\www\CIS School\sendmail.php on line 8 Message delivery failed... <?php //$to = "[email protected]"; //$subject = "Hi!"; //$body = "Hi,\n\nHow are you?"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: [email protected]' . "\r\n"; if (mail("[email protected]","test subject","test body",$headers)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Any help will be very much appreciated... Link to comment https://forums.phpfreaks.com/topic/151224-problems-configuring-wamp-to-send-emails/ Share on other sites More sharing options...
joesaddigh Posted March 26, 2009 Share Posted March 26, 2009 Yes I am getting the same error Link to comment https://forums.phpfreaks.com/topic/151224-problems-configuring-wamp-to-send-emails/#findComment-794383 Share on other sites More sharing options...
taquitosensei Posted March 26, 2009 Share Posted March 26, 2009 I would use a pre-built class for sending mail, makes it much easier, you can configure an SMTP server with authentication. I use pear's http://pear.php.net/package/Mail Link to comment https://forums.phpfreaks.com/topic/151224-problems-configuring-wamp-to-send-emails/#findComment-794385 Share on other sites More sharing options...
Stephen68 Posted March 26, 2009 Share Posted March 26, 2009 Ya I'm pretty sure you have to set up and run a mail server, WAMP does not have one. Read up on the WAMP forums for more information... Link to comment https://forums.phpfreaks.com/topic/151224-problems-configuring-wamp-to-send-emails/#findComment-794386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.