You are here: send mail error « PHP Programming Language « IT news, forums, messages
send mail error

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация