I'm trying to send emails that will bounce to an address specified by me, different from the address it's sent from.
the code i'm using to send the emails is
$headers = array (
'From' => $emailAdr
'To' => $emailDest,
'Subject' => $subject,
);
$hdrs = $mime->headers($headers);
$smtp = Mail::factory('smtp',
array ('host' => 'ssl://'.$emailServer,
'auth' => true,
'port' => '465',
'username' => $emailUser,
'password' => $emailPass));
$mail = $smtp->send($emailDest, $hdrs, $body);
I searched all over the internet for a solution to this.
Try this:
But, different mail servers translate return path by their own rules (it's just will use
From
,Reply-to
orX-Return-Path
etc