A few observations:
1. When you post code, you should use [code] tags to have it format properly.
2. You don't need the and statements. PHP takes care of that.
3. $subject on line 16 isn't defined (at least in what you have shown us).
4. The default is that mail doesn't actually get sent from the local (test) environment. It can be done but you will have to make some changes (if you need this, I'm sure that you can find references from an internet search).
chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
A few observations:
1. When you post code, you should use [code] tags to have it format properly.
2. You don't need the and statements. PHP takes care of that.
3. $subject on line 16 isn't defined (at least in what you have shown us).
4. The default is that mail doesn't actually get sent from the local (test) environment. It can be done but you will have to make some changes (if you need this, I'm sure that you can find references from an internet search).
heh, I'm not sure what strange auto_prepend_file setting you're using but PHP doesNOT automatically insert any HTML tag.
WAMP/XAMP does not come with an SMTP server so you'll have to configure the php.ini file to point to another SMTP server.
And as noted before, you haven't set the $subject variable to anything.
ShawnCplus
Code Monkey
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
One more thing, it's common practice for ISP's to block port 25. So if you are trying to set up a mailserver from your home connection, you might be out of luck. ISP's block port 25 to make sure people don't spam, or have viruses/crapware that uses their computers to send spam.
vidaj
Junior Poster in Training
68 posts since Jul 2007
Reputation Points: 45
Solved Threads: 14
To solve the first e_notice error, simply assign a value to the $subject variable before sending the mail and as for the second error, as previously mentioned it means that the mail function cannot connect to the wamp mail service. So to solve that first error the code will be as follows:
<html>
<head>
<title> send mailf from the form </title>
</head>
<body>
<?php
echo "<p> your name is: <b>".$_POST['name']."</b>,</p>";
echo "<p> your Email address is: <b>".$_POST['email']."</b></p>";
echo "<p> Your message was: ";
echo $_POST['message']."</p>";
$msg ="Name: ".$_POST['name']."\n";
$msg .="Email: ".$_POST['email']."\n";
$msg .="message: ".$_POST['message']."\n";
$recipient = "ero100@live.com";
$mailheaders ="reply-to: ".$_POST['email'];
$subject='subject'; //this was added
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
So to solve the rest, it will require resetting up a localhost mail server on your computer but the above script should be fine.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259