in reply to Re^2: Net::SMTP - To: and From: not appearing in headers?
in thread Net::SMTP - To: and From: not appearing in headers?

The date field would be blank because you did not include the originating date (a Date: line) in the headers. The format for the date is in section 3.3 (pages 13 and 14) of the aforementioned RFC.

Hope that helps.

  • Comment on Re^3: Net::SMTP - To: and From: not appearing in headers?

Replies are listed 'Best First'.
Re^4: Net::SMTP - To: and From: not appearing in headers?
by ghenry (Vicar) on May 30, 2005 at 10:05 UTC

    Ah!

    I thought the date was the date my e-mail server received the e-mail?

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!

      Nope, the date is when the message creator finalized the message prior to transport, not when it was received by any host in transit (which would be part of a Received: trace header). To quote the RFC (section 3.6.1, "The origination date field"),

      The origination date field consists of the field name "Date" followed by a date-time specification.
      orig-date       =       "Date:" date-time CRLF
      
      The origination date specifies the date and time at which the creator of the message indicated that the message was complete and ready to enter the mail delivery system. For instance, this might be the time that a user pushes the "send" or "submit" button in an application program. In any case, it is specifically not intended to convey the time that the message is actually transported, but rather the time at which the human or other creator of the message has put the message into its final form, ready for transport. (For example, a portable computer user who is not connected to a network might queue a message for delivery. The origination date is intended to contain the date and time that the user queued the message, not the time when the user connected to the network to send the message.)

      If you really want to make sure your email is correct in formatting, I would highly recommend you give the RFC a once-over.

      Hope that helps.

      Some MTAs will add a Date field if it doesn't exist, but most won't. Other MTAs (e.g. Exim) will add the Date field if the message is transmitted locally but not when it is transmitted via SMTP. In general the MUA should add a date line, and in this case your script is the MUA.