Sachin Whiteman D
Sachin Whiteman D

Reputation: 151

Reply All to emails using python Imap4

I have a working code that replies to email from a specific inbox.

msg = EmailMessage()
msg['In-Reply-To'] = orig_mail['message_id']
msg['From'] = sender
msg['To'] = recipient
msg['Subject'] = subject

I need to Reply All to that email instead of just Reply . Is there any way i can implement that here? Any help would be appreciated, Thanks.

Upvotes: 0

Views: 244

Answers (1)

Karthik
Karthik

Reputation: 2431

I don't think Reply ALL feature is there. But this would work out if you want to send mail to multiple people

recipients = ['[email protected]', '[email protected]']
msg['From'] = sender
msg['Subject'] = subject
msg['To'] = ", ".join(recipients)

Upvotes: 1

Related Questions