Hi all,
We have a php function that sends an email:
function send_mail($to, $fromemail, $fromname, $bounce_email, $message, $subject) {
// To send HTML mail, the Content-type header must be set
for($i=0;$i<count($to);$i++) {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "Return-path: <{$bounce_email}>\r\n";
$headers .= "Errors-To: <$bounce_email>\r\n";
// Additional headers
$headers .= "To: {$to[$i][1]} <{$to[$i][0]}>" . "\r\n";
$headers .= "From: {$fromname} <{$fromemail}>" . "\r\n";
// Mail it
mail($to[$i][0], $subject, $message, $headers, "f");
}
}
However, when we use this function, the server changes the "Return-path" header to:
Return-path: [email protected]
We need this email to be "[email protected]" as defined in: $bounce_email.
How would we change it from the "nobody" default?
We have a php function that sends an email:
function send_mail($to, $fromemail, $fromname, $bounce_email, $message, $subject) {
// To send HTML mail, the Content-type header must be set
for($i=0;$i<count($to);$i++) {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "Return-path: <{$bounce_email}>\r\n";
$headers .= "Errors-To: <$bounce_email>\r\n";
// Additional headers
$headers .= "To: {$to[$i][1]} <{$to[$i][0]}>" . "\r\n";
$headers .= "From: {$fromname} <{$fromemail}>" . "\r\n";
// Mail it
mail($to[$i][0], $subject, $message, $headers, "f");
}
}
However, when we use this function, the server changes the "Return-path" header to:
Return-path: [email protected]
We need this email to be "[email protected]" as defined in: $bounce_email.
How would we change it from the "nobody" default?