@@ -77,11 +77,11 @@ from email_validator import validate_email, caching_resolver
7777resolver = caching_resolver(timeout = 10 )
7878
7979while True :
80- valid = validate_email(email, dns_resolver = resolver)
80+ email = validate_email(email, dns_resolver = resolver).email
8181```
8282
8383The validator will accept internationalized email addresses, but not all
84- mail systems can send email to an addresses with non-ASCII characters in
84+ mail systems can send email to an addresses with non-English characters in
8585the * local* part of the address (before the @-sign). See the ` allow_smtputf8 `
8686option below.
8787
@@ -90,12 +90,13 @@ Overview
9090--------
9191
9292The module provides a function ` validate_email(email_address) ` which
93- takes an email address (either a ` str ` or ASCII ` bytes ` ) and:
93+ takes an email address (either a ` str ` or ` bytes ` , but only non-internationalized
94+ addresses are allowed when passing a ` bytes ` ) and:
9495
9596- Raises a ` EmailNotValidError ` with a helpful, human-readable error
9697 message explaining why the email address is not valid, or
97- - Returns an object with a normalized form of the email address and
98- other information about it.
98+ - Returns an object with a normalized form of the email address (which
99+ you should use!) and other information about it.
99100
100101When an email address is not valid, ` validate_email ` raises either an
101102` EmailSyntaxError ` if the form of the address is invalid or an
@@ -141,7 +142,7 @@ Internationalized email addresses
141142---------------------------------
142143
143144The email protocol SMTP and the domain name system DNS have historically
144- only allowed ASCII characters in email addresses and domain names,
145+ only allowed English ( ASCII) characters in email addresses and domain names,
145146respectively. Each has adapted to internationalization in a separate
146147way, creating two separate aspects to email address
147148internationalization.
@@ -167,11 +168,17 @@ using the [idna](https://github.com/kjd/idna) module by Kim Davies.
167168### Internationalized local parts
168169
169170The second sort of internationalization is internationalization in the
170- * local* part of the address (before the @-sign). These email addresses
171- require that your mail submission library and the mail servers along the
172- route to the destination, including your own outbound mail server, all
173- support the [ SMTPUTF8 (RFC 6531)] ( https://tools.ietf.org/html/rfc6531 )
174- extension. Support for SMTPUTF8 varies.
171+ * local* part of the address (before the @-sign). In non-internationalized
172+ email addresses, only English letters, numbers, and some punctuation
173+ (` ._!#$%&'^``*+-=~/?{|} ` ) are allowed. In internationalized email address
174+ local parts, all Unicode characters are allowed by this library, although
175+ it's possible that not all characters will be allowed by all mail systems.
176+
177+ To deliver email to addresses with Unicode, non-English characters, your mail
178+ submission library and the mail servers along the route to the destination,
179+ including your own outbound mail server, must all support the
180+ [ SMTPUTF8 (RFC 6531)] ( https://tools.ietf.org/html/rfc6531 ) extension.
181+ Support for SMTPUTF8 varies. See the ` allow_smtputf8 ` parameter.
175182
176183### If you know ahead of time that SMTPUTF8 is not supported by your mail submission stack
177184
0 commit comments