Jump to content

Mail function from within WAMP


daddyalfie

Recommended Posts

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);

 

?>

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...