• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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