I have a email object of an unread email. How do I reply to the email using smtp lib using the email object. I have refered to Setting different reply-to message in Python email/smtplib link. Here they are using the email sender to reply to the email. I tried using the same method without adding a to address and only using msg['reply-to']
, but was getting an error which is attached below. But when I use msg['to']
I was able to send the email to the sender but was not able to reply to the email.
ERROR:
smtplib.SMTPRecipientsRefused: {'None': (553, b'5.1.3 The recipient address <None> is not a valid RFC-5321 address. Learn\n5.1.3 more at\n5.1.3 https://support.google.com/mail/answer/6596 ij25-20020a170902ab5900b0016beceac426sm3191763plb.138 - gsmtp')}