Results 1 to 2 of 2

Thread: PHP mail() headers

Hybrid View

  1. #1
    Join Date
    Mar 2008

    Question PHP mail() headers

    I stumbled across a mail script so long ago, I can't remember where. The person who wrote it included a bunch of headers, I might guess every type of header you can possibly use with PHP (but I don't know much about it).

    I'd like to know what headers are necessary and which are recommended, whether or not they're they're in this script I have.

    I'd also like to know if the ini_set line is necessary.

    & if you have any other advice concerning PHP mail, kindly fill me in. Thanks.

    PHP Code:


    ini_set(sendmail_path"/usr/sbin/sendmail -t -f $from");


    $headers "From: $sender_name<$from>\n";
    $headers .= "Reply-To: $sender_name<$from>\n";
    $headers .= "X-Sender: $sender_name<$from>\n";
    $headers .= "X-Mailer: PHP4\n";
    $headers .= "X-Priority: 3\n";
    $headers .= "Content-Transfer-encoding: 8bit\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "X-MSMail-Priority: High\n";
    $headers .= "Importance: 3\n";
    $headers .= "Date: $date\n";
    $headers .= "Delivered-to: $to\n";
    $headers .= "Return-Path: $sender_name<$from>\n";
    $headers .= "Content-Type: text/plain; charset=UTF-8\n";


  2. #2
    Join Date
    May 2009
    As far as I am aware you only NEED the following. I assume that not including a 'from' address will get you recognised as spam. Anything else is extra. I only use the following for simple scripts.

    PHP Code:

    $headers "From: $from";

    Last edited by whirlwind; 09-05-2009 at 05:10 AM. Reason: correction

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center