1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

mail problem

Discussion in 'Plesk for Linux - 8.x and Older' started by dottor, Jun 20, 2007.

  1. dottor

    dottor Guest

    0
     
    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.
     
  2. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    You put that in the PHP script that is sending the emails.
     
  3. flupke

    flupke Guest

    0
     
Loading...