You have to use sendmail with the -f flag. 
I have written a small test util to do this:

<?php
$address = "recipient@address";
$message = "Subject: Test\n";
$message.= "\n message";
$result = `echo -e "$message" | /usr/sbin/sendmail -f your@address
$address`;
$result.= `$message`;
echo $result;
?>


On Thu, 2003-01-23 at 16:12, Adam Voigt wrote:
> I have a site with a PHP auto-mailer where the owner of the site gets a
> report
> generated from the DB, it all works fine, except his server has spam
> filtering enabled
> so the FROM header in my PHP-Generated email, which says
> "apache@hostname"
> doesn't work because what the hostname is set to, isn't resolveable
> outside our network.
> Now I know I can just set the servers hostname to a valid DNS name, but
> this brings
> up another problem, even though I'm manually setting the "From" and
> "Reply-to" headers
> in the PHP mail command (the last parameter), when the email's are
> listed in his box, it works,
> if you open the headers in the email near the very top it still says
> "From: apache@hostname" and a little ways below it says the From and
> Reply-to I set.
> 
> So, is there anyway to override the top From which says apache@hostname?
> Maybe
> setting additional parameters on my sendmail command line in the
> php.ini? Any ideas?
> I appreciate it.
> 
> -- 
> Adam Voigt ([EMAIL PROTECTED])
> The Cryptocomm Group
> My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to