I'm using the PHP Pear Mail_Mime library to send email. In my script, I set the "From:" header before sending the message. This all works fine on a server running Mac OS X, (which presumably uses sendmail as the mailer, although I'm not 100% sure.) When sending a test email, the "From:" field shows the correct sender.
However, if I run the same script on a Linux server with Exim4 as the mailer, the email is still sent but the "From:" header shows up as a default instead of the one I specified in the script.
I've tried setting the "-f [from email address]" option in the "additional parameters" for PHP's mail function, but this seems to have no effect.
Can anyone tell me how I might get the from header to work properly with Exim?
Any advice is greatly appreciated.
Cheers, Tom
EDIT: here's the code in case anyone is interested in looking at it.
<?php
include_once('Mail.php');
include_once('Mail/mime.php');
$subject = "mime mail test";
$from = "wtf@domain.com";
$to = "wtf@domain.com";
$visitor_email = $from;
$message = new Mail_mime();
$message->setTXTBody("hallo there!");
$body = $message->get();
$extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$visitor_email);
$headers = $message->headers($extraheaders);
$mail = Mail::factory("mail");
$result = $mail->send($to, $headers, $body, "", "-f wtf@domain.com -r wtf@domain.com");
print_r($result);
?>