I´m having some serious issues with setting the return path when I´m sending mail with mail().
Heres what I do:

$headers = "From: $row[user_name] <$row[user_email]>\r\n";
$headers .= "Return-Path: test@test.se \r\n";
$headers .= "Cc: $sendmail_recipents_cc\r\n";
$headers .= "Bcc: $recipents_bcc\r\n";
$headers .= $out[1];
mail($sendmail_recipents, $sendmail_subject, $out[0], $headers);

Echoing $headers gives this:

From: Joel Abrahamsson
Return-Path: test@test.se
Cc:
Bcc:
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
BOUNDARY="-lib_multipart-0.21414200.1054548542"
X-Generated-By: Lib Multipart for PHP, Version 1.0.0;
http://www.nirvani.net/software/

But when I check the headers of the actual sent mail:

Return-Path: <nobody@kylie.webpoesi.com>

So it looks like PHP can´t set the return path for sendmail ? How can I fix this ?

    I´m afraid that doesn´t help either 🙁

      Write a Reply...