send mail error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Dear friends

               I am sending mail from my site but it gives me some

"Warning: mail() [function.mail]: "sendmail_from" not set in php.ini
or custom "From:" header missing in C:\P............."

     my code is this

// multiple recipients
$to  = '' ; // note the comma

// subject
$subject = 'Suggestion from Website';

// message
 $Name = $_POST['Name'];
 $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.


Re: send mail error wrote:
Quoted text here. Click to load it

Like the message says.  You either need to set the sendmail_from in your  
php.ini file, or you need to add the From: header.

Any mail sent by PHP must identify who it's from.  It can either be a  
default in your php.ini file or one you specify. But it must be there.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline