Miksus / red-mail

Advanced email sending for Python
https://red-mail.readthedocs.io
MIT License
398 stars 32 forks source link

Issue on page /faq.html #53

Open karthik0330 opened 2 years ago

karthik0330 commented 2 years ago

I wanted to download all the attachments from a received mail. can provide the sample python code ?

Miksus commented 2 years ago

Do you mean that you would like to get the attachments of an email that could be sent by Red Mail? Red Mail operates on SMTP which, unfortunately, cannot read any received emails. It can only send emails.

You can get the email that would be sent via Red Mail using either get_message or mock the sender: https://red-mail.readthedocs.io/en/latest/tutorials/testing.html. The attachments should be in the EmailMessage, cannot remember where they are on top of my head though.

Does this answer the question or did I get the question?