i am learning how to send an email.i have installed appserver and in files php.ini-dist and php.ini-recommended i did the following changes
SMTP=localhost
[email protected]
i replaced localhost with mail.ptcl.net which is my dsl provider and replaced [email protected] with my email address [email protected]
i get the following message when i submit the form
"warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\AppServ\www\Hamza\send_simpleform.php on line 14 The following e-mail has been sent:
Hamza: hamza
Message: adasdas"
following is the script i am using
<html>
<head>
<title>Simple Feedback Form</title>
</head>
<body>
<form method="post" action="send_simpleform.php"/>
<p><strong>Your name</strong><br/>
<input type="text" name="sender_name" size="30" /></p>
<p><strong>Senders Email address</strong><br/>
<input type="text" name="sender_email" size="30" /></p>
<p><strong>Enter your Message here</strong><br/>
<textarea name="message" cols="30" rows="5" wrap="virtual"></textarea></p>
<p><input type="submit" value="send this form" name="submit"/></p>
</form>
</body>
</html>
<?php
if(($_POST[sender_name]=="")||($_POST[sender_email]="")||($_POST[message==""] ))
{ header("location=simple_form.html");
exit;
}
$msg="E-MAIL SENT FROM WWW SITE\n";
$msg="Sender's Name: $_POST[sender_name]\n";
$msg="Sender's E-Mal I.D: $_POST[sender_email]\n";
$msg="Message: $_POST[message]\n";
$to="[email protected]";
$subject="Web site feedback";
$mailholders="from my website<[email protected]>\n";
$mailheader="Reply-to: $_POST[sender_email]\n";
mail($to, $subject,$msg,$mailheaders);
?>
<html>
<head>
<title>Simple Feedback Form Sent</title>
</head>
<body>
<h1>The following e-mail has been sent:</h1>
<p><strong>Hamza:</strong><br\>
<?php echo "$_POST[sender_name]";?>
<p><strong>[email protected]</strong><br\>
<?php echo "$_POST[sender_email]";?>
<p><strong>Message:</strong><br>
<? echo "$_POST[message]";?>
</body>
</html>