Questions tagged [rfc2822]

Standard syntax for text messages sent between computer users, within the framework of "electronic mail" messages.

This RFC replaces RFC822 and has been deprecated in favor of RFC5322.

It should be noted that this standard only specifies a syntax for text messages and does not cover the exchange of multimedia in emails (this being covered by MIME documents [RFC2045, RFC2046, RFC2049]).

It should also be noted that, while emails consist of both an envelop and the content, this RFC does not cover the envelop (see [RFC2821] for discussion on the envelop).

References: http://tools.ietf.org/html/rfc2822

63 questions
36
votes
5 answers

Convert Python datetime to rfc 2822

I want to convert a Python datetime to an RFC 2822 datetime. I've tried these methods to no avail: >>> from email.Utils import formatdate >>> import datetime >>> formatdate(datetime.datetime.now()) Traceback (most recent call last): File…
Adam Nelson
  • 7,932
  • 11
  • 44
  • 64
21
votes
7 answers

Parsing RFC 2822 date in JAVA

I need to parse an RFC 2822 string representation of a date in Java. An example string is here: Sat, 13 Mar 2010 11:29:05 -0800 It looks pretty nasty so I wanted to make sure I was doing everything right and would run into weird problems later…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
18
votes
2 answers

Which date formats are IETF-compliant RFC 2822 timestamps?

I need to parse dates in JavaScript. The format is [2 digits day]/[2 digits month]/[4 digits year] [2 digits hour (24 mode)]:[2 digits minute] For example, 16/02/2013 21:00 But if I do new Date('16/02/2013 21:00').toString(), it gives 'Wed Apr 02…
Oriol
  • 274,082
  • 63
  • 437
  • 513
18
votes
3 answers

Should email "Date" header be sender's local time or UTC?

I'm writing a web-based email client in Python and a question has arisen about which time zone the "Date" header of an email should be represented as when sending. RFC 2822 states in section 3.3 that: The date and time-of-day SHOULD express local…
kuhnza
  • 731
  • 1
  • 5
  • 15
16
votes
3 answers

Is there a "no-reply" email header?

I often see automated emails postfixed with a message like Amazon: *Please note: this e-mail was sent from an address that cannot accept incoming e-mail. Please use the link above if you need to contact us again about this same…
Evan Krall
  • 2,915
  • 3
  • 23
  • 20
16
votes
1 answer

Validation/Format of display-name in from header

I need to know what are the rules for validation/format from(name-addr) field in the email. In rfc explained the format of name-addr, but goes into detail about the display-name. Like this: From: John Q. Public I want to know the…
Iago
  • 308
  • 3
  • 9
12
votes
3 answers

How to send message to multiple recipients?

I'm having some trouble sending a message to multiple addresses using the Gmail API. I've successfully sent a message to only one address, but get the following error when I include multiple comma-separated addresses in the 'To' field: An error…
Jordan Hawkins
  • 141
  • 1
  • 8
12
votes
1 answer

How do I create a message-id for email in python?

I would like to add a unique RFC2822 compliant Message-ID header to a message created using Python's built in email library. How would I got about doing this? Is there a way within the library itself?
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
9
votes
2 answers

Elegant way to serialize a MailMessage object in .NET

I'm currently looking at serializing a MailMessage object in C# and although there are a couple of variations of an example on the net, they serialize to binary which kind of misses the point IMO. My approach is that I'd like to serialize a…
PaulV
  • 195
  • 1
  • 9
9
votes
2 answers

What is the difference between RFC1123 and RFC2822 DateTime formatting in PHP?

This is out of curiosity rather than because I need to know it at this point, but in the PHP manual, they're identical; I can't see the reason that there are two different data formats for the same…
MattMatt
  • 2,242
  • 33
  • 30
8
votes
4 answers

regex to validate a message-ID as per RFC2822

I have not found a regexp to do this. I need to validate the "Message-ID:" value from an email. It is similar to a email address validation regexp but much simpler, without most of the edge cases the email address allows, from rfc2822 msg-id …
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
7
votes
2 answers

How to convert a string with timezone abbrevation to a datetime object?

I was trying to convert a string to a datetime object. The string I got from a news feed is in the following format: Thu, 16 Oct 2014 01:16:17 EDT" I tried using datetime.strptime() to convert it. i.e., datetime.strptime('Thu, 16 Oct 2014 01:16:17…
Victor Gau
  • 191
  • 2
  • 11
6
votes
4 answers

C# Email Regular Expression -- Any out there that adhere to the RFC 2822 guidelines?

I realize that there are a ton of regex email validations, but I can't seem to find one that adheres to the RFC 2822 standard. The ones I find keep letting in junk like ..@abc.com get through. Forgive me if the one of the questions is already…
myermian
  • 31,823
  • 24
  • 123
  • 215
6
votes
2 answers

Parse RFC 2822 email addresses in Java

As many people are unaware, email addresses require a library to parse. Simple regexes, like @(.*), are not sufficient. Email addresses can even contain comments, which can contain characters like @, breaking simple regexes. There is a Node.js…
djechlin
  • 59,258
  • 35
  • 162
  • 290
6
votes
2 answers

What is the "formal" name of MySQL's DATETIME format?

Does anybody know the formal name of the YYYY-MM-DD HH:MM:SS date format used by a MySQL DATETIME? Is there one? It looks close to ISO 8601, but it's different enough to break in most applications if you try to use the two interchangeably. Sometimes…
smitelli
  • 6,835
  • 3
  • 31
  • 53
1
2 3 4 5