Help needed! When sending an email to sync using Python, I encountered an error in the note part

29 views
Skip to first unread message

古道(http://www.GudaoVision.com)

unread,
Apr 8, 2024, 12:51:35 AMApr 8
to MyLifeOrganized
Help needed! When sending an email to sync using Python, I encountered an error in the note part. The error message is:

--===============0561548188890947013==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64

5rWL5q2j5paH

--===============0561548188890947013==--

The Python code is as follows:

# Creating the email object
msg = MIMEMultipart()
msg['From'] = email_username
msg['To'] = recipient_email
msg['Subject'] = subject

# Adding the email body to the MIMEMultipart object, directly specifying the content type and character set to avoid automatic selection of base64 encoding
#text_part = MIMEText(body, _subtype='plain')
text_part = MIMEText(body, _subtype='plain', _charset='utf-8')
msg.attach(text_part)

How should I modify this? Thank you!
Reply all
Reply to author
Forward
0 new messages