My turn for mail() help

skypanther

Exalted Code Master!
I've got a client site on wincf that worked fine before the server troubles. Now, the contact form won't send mail. No errors and the follow-up page I have there loads just fine. The mail message is just never sent.

I tried my own suggestion and added ini_set("SMTP", "mail.clientsdomain.com"); to the send mail file. That just gave me this error:

Warning: mail(): SMTP server response: 554 sorry, your envelope sender is in my badmailfrom list (#5.7.1) in E:\hshome\username\clientsdomain.com\sendmail.php on line 139

Here's my mail() code, using values pulled from an HTML form and manipulated in various ways:

Code:
if($from != "" && $to != "" && $subject != "")
  {
  $headers = "MIME-Version: 1.0\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
  $headers .= "X-Priority: 1\n";
  $headers .= "X-MSMail-Priority: High\n";
  $headers .= "X-Mailer: php\n";
  $headers .= "From: " . $from . "\n";

  mail($to, $subject, $body, $headers);
  }

Suggestions?
Tim
 
Thanks Dave. That's what I did late last night. They put a php.ini in my site with a sendmail_from = 'from_address' line in there and I'm all set now.

Thanks for the advice.
Tim
 
Back
Top