I use code below to send mails:
...
msg = MIMEText(htmlString, 'html', 'utf-8')
msg["Subject"] = "Test Subject"
sm = smtplib.SMTP(SMTPSERVER, port=PORT, timeout=TIMEOUT)
sm.set_debuglevel(1)
# sm.ehlo()
# sm.starttls()
# sm.ehlo()
sm.login(username, password)
sm.sendmail(from_address, to_address, msg.as_string())
sm.quit()
The question is, every time when I send the mail with same Subject
, the mail can not send out successfully.
I tried different Subject
with Test Subject1
and Test Subject2
and "est Subject...
and then the mail sent out successfully immediately.
I have checked the SMTPSERVER
, there is no filter by Subject
.
How can I find the reason and solve this problem?