asweigart / asweigart/ezgmail

Email body cannot be read when there are attachments

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
273
Forks
59
PR merge metrics
No merged PRs in 30d

Description

I am able to read the body of an email when there are no attachments. However, when I add in a few attachments like a pdf, jpg or a PNG file I am not able to read the email body using the .body attribute. I get an error instead - 'AttributeError: 'GmailMessage' object has no attribute 'body'(see the picture below) :
![error](https://user-images.githubusercontent.com/50551629/59320546-4b573180-8d01-11e9-9b3a-6a3943e6bf90.PNG)
I have also tried to attach smaller files in the hope that it will work, but to no avail.
May I know if there is any way to solve this problem?
Thank you.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a GmailMessage containing PDF, JPG, or PNG attachments and inspect how its .body attribute is populated. Confirm the behavior for messages without attachments, then verify that the body remains readable when attachments are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.