Inline images not recognized as attachment
See original GitHub issueMy code basically looks like this:
for att in message.attachments:
att.save(att_path)
This recognizes all attachments, including inline images, and adds them to a folder. But this only works if the e-mail has actual separate attachments (i.e. you see the paperclip). If the email ónly contains inline image (pasted images, company logo’s) it won’t add any attachments.
If I had a if message.has_attachment()
in my code this would make sense, but I don’t.
How do I fix this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Embeded/Inline pictures not showing up - Microsoft Community
Embeded/Inline pictures not showing up. Some of my emails from companies that I've received today, the pictures won't load.
Read more >Inline images are no longer showing, it only has text saying ...
So everything looks great. When the message is sent, the inlined image is converted to an attachment.
Read more >Image attachments are not displayed inline in wiki renderer ...
Problem. Image attachments do not display inline in wiki renderer fields when using the wiki markup such as !image.png! in a JIRA issue....
Read more >Gmail attachments and inline images are not included in the ...
The email has both an inline image file in the body, and a file attachment. I want to put the full email into...
Read more >Email photo as attachment, not embedded, in iOS 14
I found a workaround that is working well for me. Instead of sending them to your email through the email app, send them...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I’ve found the issue.
The Graph docs says that the property ‘hasAttachments’:
Ok. so:
With these steps It should work.
Here is an e-mail with just 3 inline images:
Here is that same e-mail with one more image (hackerman.png) added as an attachment:
So now it suddenly recognizes all attachments, incl inline images. So it really seems to me that there is some kind of check for attachments in Python O365 that is causing this behavior. Unless of course Azure O365 is handling e-mails with attachments differently than those without.