• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

From header in php mail() being overwritten

jorfermo

Regular Pleskian
I'm trying to send email from a domain using code like this:

$email = "[email protected]";
$from = "From: $email\r\n";
mail($receiver, $subject, $message, $from);

But i see in the mail logs that from address is being overwritten using the default user for the domain. Is there anyway to configure plesk or postfix to respect those headers?

Thx!
 
I found that adding "-f $receiver" as last parameter of mail() function makes it work.

But why the headers are not working?
 
Back
Top