Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtaining Email Message HTML body error #9

Open
mdp18 opened this issue May 10, 2023 · 2 comments
Open

Obtaining Email Message HTML body error #9

mdp18 opened this issue May 10, 2023 · 2 comments

Comments

@mdp18
Copy link

mdp18 commented May 10, 2023

Hi there, I get the following error when attempting to get an html email via redbox.

Traceback (most recent call last): File "/Users/max/support-bot/sandbox.py", line 45, in <module> test2() File "/Users/max/support-bot/sandbox.py", line 43, in test2 print(emails[0].html_body) File "/Users/max/.local/share/virtualenvs/support-bot-ZEAB9n9N/lib/python3.10/site-packages/redbox/models/message.py", line 48, in html_body return insp.get_html_body() File "/Users/max/.local/share/virtualenvs/support-bot-ZEAB9n9N/lib/python3.10/site-packages/redbox/utils/inspector.py", line 15, in get_html_body content_type = pl['Content-Type'].split(";") TypeError: string indices must be integers

Any insight would be great.

@meap02
Copy link

meap02 commented Nov 29, 2023

Bump, same issue when attempting to get msg.text_body. I think inside of the Inspector class, the get methods use the self.message,get_payload() function. The variable is then indexed with pl['content-type'] and throws an error. My hypothesis is that the function has changed from returning a dictionary to returning a list and now the variable pl must be indexed with pl[0] or pl[1].

@wompking
Copy link

wompking commented Dec 5, 2023

Bump, same thing happens here with msg.html_body. Weirdly enough, it doesn't happen when I use Outlook to send my bot an email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants