using php mail() is there a way to changed the time

Posted on 2011-05-02
Last Modified: 2012-08-14
using php mail() is there a way to changed the time that the mail is sent

I notice that a mail which gmail considers a new mail but the date (year) is 1969
Question by:rgb192
    LVL 14

    Expert Comment

    by:Scott Madeira
    If the year is 1969 then that means there was probably no date set in the message by the mail server.

    Dates are managed by the mail server and not the php mail() function.  I'd start looking at the sending server and go from there.
    LVL 48

    Accepted Solution

    You can add the Date-Header to your message. This field is typical use by the Mail clients to display thje date of the mail.

    mail('', 'Subject', 'Body', 'Date: Fri, 22 Apr 2011 00:17:10 +0200');

    Open in new window


    Author Comment

    i tried
    mail('', 'Subject', 'Body', 'Date: Fri, 22 Apr 2011 00:17:10 +0200');

    and in gmail the date was not changed

    Author Closing Comment


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now