Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I’m learning php for the first time and now, I’m learning about the conditional statements. There was an email() function in of the examples.

Here’s the code:
mail($to,$subject,$body, "From: $form")

The variables have their values.

Every time I click the submit button, I get an error regarding the mail() function.
Here are the 2 errors:

Notice: Undefined variable: form in C:\wamp\www\Sipherz\creg.php on line 52

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\Sipherz\creg.php on line 52

Should the page be live server for the code to send emails? I’m using a WAMP Server for testing and running my code. Should I download any particular application or something? It would be great if you could guide me.

Thank you.
Posted

1 solution

You have configure your wamp for sending email, check this out: send-email-wamp-using-gmail-smtp-and-php[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900