• 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

mail problem

D

dottor

Guest
php mail functions show anonymous@

I found this in knowledgeable

where do I do this

When using the php mail() function within a php script emails are sent out as "[email protected]". I would like the emails sent from a script to use the header information supplied in the mail() function.
Article ID : 1251
Last Review : Sep,12 2006
APPLIES TO:

* Plesk for Linux/Unix

RESOLUTION





To set the correct headers for the Return-Path you need to use the code like below:

putenv ("QMAILUSER=USER");
putenv ("QMAILNAME=FULL_USER_NAME");
putenv ("QMAILHOST=DOMAIN");
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain;charset=us-ascii\r\n";
$headers .= "From: FULL_USER_NAME <USER@DOMAIN>";
$to="[email protected]";
$subject = "Testing email";
$body = "";
$err = mail($to, $subject, $body, $headers);

In result mail will have FULL_USER_NAME<USER@DOMAIN> in Return-Path.
 
Back
Top