598 was caused by unicode characters from the user's full name being included in the to header of the validation email.
I re-worked the email code to simplify and standardize it:
Email header creation moved into EmailHelpers.py as create_email_headers
This sets the From,To headers properly encoding any unicode, which is what caused 598.
Base64 encoding of the email body/template moved into EmailHelpers.py as get_emaiL_message
This standardizes the creation of an EmailMessage object, setting headers, and attempting the Base64 encoding, falling back to a normal email if it fails
As a bonus, this replaces the function I added previously 'email_rfc2822_compliance', as this solution encompasses that and is more robust
Moved sending code into EmailHelpers.py as send_email_message
Changed from sendmail to send_message since we are using an EmailMessage object now
Updated send_validate_message to use the new functions
Updated create_validate_message to use the new functions
Updated ForgotPasswordHandler to use the new functions
Updated create_reset_message to use the new functions
598 was caused by unicode characters from the user's full name being included in the to header of the validation email.
I re-worked the email code to simplify and standardize it:
Email header creation moved into EmailHelpers.py as create_email_headers
Base64 encoding of the email body/template moved into EmailHelpers.py as get_emaiL_message
Moved sending code into EmailHelpers.py as send_email_message
Updated send_validate_message to use the new functions
Updated create_validate_message to use the new functions
Updated ForgotPasswordHandler to use the new functions
Updated create_reset_message to use the new functions