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?
Asked
Active
Viewed 6,734 times
12
-
1This should never have been closed as off-topic. It was perfectly clear exactly what the question was. The request for a library recommendation could've easily been edited out or ignored, especially since the answer is in the Python standard library itself. – Omnifarious Jun 08 '18 at 17:50
1 Answers
16
This might help:
from email.utils import make_msgid
make_msgid()
This is described here:
https://docs.python.org/2/library/email.utils.html#email.utils.make_msgid
https://docs.python.org/3/library/email.utils.html#email.utils.make_msgid

Lex Scarisbrick
- 1,540
- 1
- 24
- 31

Jean-François Roche
- 431
- 3
- 5