• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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