Posted by upendrajpr on 11/16/07 10:11
Dear friends
I am sending mail from my site but it gives me some
error
"Warning: mail() [function.mail]: "sendmail_from" not set in php.ini
or custom "From:" header missing in C:\P............."
my code is this
"
<?php
// multiple recipients
$to = 'upendrajpr@gmail.com' ; // note the comma
// subject
$subject = 'Suggestion from Website';
// message
$Name = $_POST['Name'];
$message=$_POST['comments'];
$phoneno=$_POST['phoneno'];
$email = $_POST['email'];
//$headers = 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// To send HTML mail, the Content-type header must be set
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",
$email)) {
echo "<h4>Invalid email address</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($subject == "") {
echo "<h4>No subject</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
}
/* Sends the mail and outputs the "Thank you" string if the mail is
successfully sent, or the error string otherwise. */
elseif (mail($to, $subject, $message)) {
echo "<h4>Thank you for sending suggestion</h4>";
} else {
echo "<h4>Can't send email from $email</h4>";
}
?>
plz anybody tell me what could I send my mail.
Thanx in advance.
upendra
[Back to original message]
|