• 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.

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 "anonymous@hostname.tld". 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="mail@domain.tld";
$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