Last active
June 12, 2016 07:52
-
-
Save berkerpeksag/d7a87a6cda9375e93a5c71f53cece854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import email | |
import email.policy | |
from email.mime.multipart import MIMEMultipart | |
m = email.message_from_string('', policy=email.policy.default) | |
m['To'] = '[email protected]' | |
m['To'] = '[email protected]' # will raise ValueError | |
# and here is an alternative way | |
m = MIMEMultipart() | |
m.policy = email.policy.default | |
m['To'] = '[email protected]' | |
m['To'] = '[email protected]' # will raise ValueError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment