rob-luke / emails-html-to-pdf

Convert emails without attachments to pdf and send as email
32 stars 7 forks source link

BUG: Attachments send via Outlook.com (Microsoft Exchange) are converted to ATT00001.bin #9

Closed mirisbowring closed 2 years ago

mirisbowring commented 2 years ago

Hi,

i tried converting and sending Documents which worked fine. BUT when i use an microsoft exchange email server, the pdf attachment gets renamed to ATT000001.bin

Seems like this guy had the same problem and got it fixed this way:

https://stackoverflow.com/questions/52323022/pythons-email-message-library-output-not-getting-accepted-by-outlook-365-when-i

or

https://stackoverflow.com/questions/59989806/email-attachment-file-names-are-removed-with-at00001

mirisbowring commented 2 years ago

It was indeed fixed by changing https://github.com/rob-luke/emails-html-to-pdf/blob/7af186fcd8792b644321a18d5e08e35c6495b050/src/main.py#L48 to 'attachment', filename=format(Path(path).name))