• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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