user13973948
user13973948

Reputation: 72

How to reply to email object smtp mail

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')}

Upvotes: 0

Views: 220

Answers (1)

Corralien
Corralien

Reputation: 120391

Use pd.merge:

generated_file = pd.read_excel("generated_file.xlsx")
database = pd.read_excel('database.xlsx')

generated_file.merge(database, on='PRODUCT', how='left')

OR from your code, use .isin:

out = database[database["PRODUCT"].isin(result)]

Upvotes: 1

Related Questions