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 = "dsdsd@gmail.com"; //$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: sender@sender.com' . "\r\n"; if (mail("dsadad@bournemouth.ac.uk","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... Quote 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 Quote 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 Quote 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... Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.