rpaframework
rpaframework copied to clipboard
RPA.Email.ImapSmtp save_attachments doesn’t save .msg files attached to the email (ItemAttachment objects)
Reopened - this issue was closed by mistake as it was created after July 2023
@21010 Hi thank you for the report.
Question: Which version of rpaframework you are using ?
Question: Is this report actually about RPA.Email.Exchange library and not about RPA.Email.ImapSmtp ?
My response below is related to the latter.
I tried to replicate the issue with an email containing one .msg file (saved one email from Outlook), one .pdf file and one .png file and all were saved correctly.
My code
EMAIL.authorize()
messages = EMAIL.list_messages('SUBJECT "Testing attachments"')
for m in messages:
attachments = EMAIL.save_attachment(m, "./attachments", overwrite=True)
print(f"Saved attachments: {attachments}")
attachments = EMAIL.save_attachments('SUBJECT "Testing attachments"', "./attachments", overwrite=True)
print(f"Saved attachments: {attachments}")
run output
Saved attachments: ['attachments\\Elennith.pdf', 'attachments\\keywords_in_outline.png', 'attachments\\meili.msg']
Saved attachments: ['attachments\\Elennith.pdf', 'attachments\\keywords_in_outline.png', 'attachments\\meili.msg']
Question: Can you provide more details on these messages ? Was the .msg attachment the only attachment in that specific email ?