I have a mail script with these code snippets:
$headers['From'] = 'Server <valid_account@mydomain.com>';
$headers['To'] = $to;
$headers['Subject'] = 'Mail Test from Server';
$headers['Reply-To'] = 'no-reply@mydomain.com';
$headers['Bcc'] = '';
$headers['Return-Path'] = 'valid_account@mydomain.com';
...
$mail_object =& Mail::factory('mail');
$mail_object->send($recipient, $headers, $body);
...
// Define SMTP Parameters
$params['host'] = 'mail.mydomain.com';
$params['port'] = '25';
$params['auth'] = 'PLAIN';
$params['username'] = 'valid_account@mydomain.com';
$params['password'] = 'abcdefgh';
Here are the mail headers from the incoming message:
Received: from nobody by vps.mydomain.com with local (Exim 4.82)
(envelope-from <nobody@vps.mydomain.com>) id 1WTE9v-0002NR-C8; Thu, 27
Mar 2014 13:32:07 -0400
To: <myaccount@yahoo.com>
Subject: Mail Test from Server
From: Server <valid_account@mydomain.com>
Reply-To: <no-reply@mydomain.com>
Message-ID: <E1WTE9v-0002NR-C8@vps.mydomain.com>
Sender: Nobody <nobody@vps.mydomain.com>
Date: Thu, 27 Mar 2014 13:32:07 -0400
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - vps.mydomain.com
X-AntiAbuse: Originator/Caller UID/GID - [99 99] / [47 12]
X-AntiAbuse: Sender Address Domain - vps.mydomain.com
X-Get-Message-Sender-Via: vps.mydomain.com: uid via acl_c_vhost_owner from authenticated_id: nobody from /only user confirmed/virtual account not confirmed
X-PM-Spam-Prob: : 9%
MIME-Version: 1.0
Content-Type: text/plain
Return-Path: nobody@vps.mydomain.com
My Question / My Need
How do I change my mail script to show the proper from address? s/b Server <valid_account@mydomain.com>
and not Nobody <nobody@vps.mydomain.com>