daddyalfie Posted November 6, 2011 Report Posted November 6, 2011 I am following Stefan's video course on Beginner's PHP. When I try to test the mail-function from within my "Local Host" (via WAMP), 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\PHP Testing\Form Experiment\form_try.php on line 10 I suspect it is a "path thing". Here is my php code so far: <?php $first_name = $_POST["name_first"]; $surname = $_POST["name_last"]; //print "First name: {$first_name} <br> with a Surname of: {$surname}"; $email_message = "First name: {$first_name} with a Surname of: {$surname}"; mail('daddyalfie@gmail.com','I have a Response!',$email_message); ?> Quote
falkencreative Posted November 8, 2011 Report Posted November 8, 2011 It's a common problem when working on your local computer. Usually I suggest this is something that you skip, and test on a live webserver rather than WAMP or MAMP. I believe it's possible to edit your php.ini file to change the smtp/smtp port settings, but it isn't something I've personally done. Quote
daddyalfie Posted November 13, 2011 Author Report Posted November 13, 2011 As always Ben, thanks so much! I suspected that was the problem / solution Alfie Quote
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.
Note: Your post will require moderator approval before it will be visible.