david-remone123 Posted May 11, 2009 Share Posted May 11, 2009 I've been using this tutorial to add a simple contact us form to my page: http://www.kirupa.com/web/php_contact_form.htm Just wondering, as my website isn't uploaded onto a server and Im running it from localhost at the mo, is there anything I can do to test that the email actually sends? When I run it now, I get the following error message: 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\mailer.php on line 69 On lines 68-72 I have the following code: echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "blarg!"; } Thanks. Link to comment https://forums.phpfreaks.com/topic/157736-localhost-mailing/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2009 Share Posted May 11, 2009 The easiest thing to do would be use the phpmailer class (search for that if you need to) and set the parameters so that is uses your SMTP mail server. Then when you put the script onto your actual live web server, it will work without any changes (or at the most you will need to change the SMTP host setting.) Link to comment https://forums.phpfreaks.com/topic/157736-localhost-mailing/#findComment-831956 Share on other sites More sharing options...
david-remone123 Posted May 11, 2009 Author Share Posted May 11, 2009 The easiest thing to do would be use the phpmailer class (search for that if you need to) and set the parameters so that is uses your SMTP mail server. Then when you put the script onto your actual live web server, it will work without any changes (or at the most you will need to change the SMTP host setting.) Thanks for the reply. I went to this site http://www.phpclasses.org/browse/package/264.html and downloaded the phpmailer class files, but I don't actually know what to do with SMTP. The email address I want to send it to is a hotmail one, so would I need to configure the file for this? And how do I get my website to use these phpmailer class files to use the settings? Thanks Again. Link to comment https://forums.phpfreaks.com/topic/157736-localhost-mailing/#findComment-831971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.