Skip to content

Commit

Permalink
Add support for html (or other formats)
Browse files Browse the repository at this point in the history
This way, people can send emails with html in it. And not be forced to just send plain emails.
  • Loading branch information
Zwork101 committed Oct 4, 2017
1 parent 1df0ea3 commit 7a0ab55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gmaillib.py
Expand Up @@ -15,8 +15,9 @@
#6. body -- content of the email

class message:
def __init__(self, fetched_email):
accepted_types = ['text/plain']
def __init__(self, fetched_email, *args, **kwargs):

accepted_types = kwargs.get('types', ['text/plain'])
parsed = email.message_from_string(fetched_email)
self.parsed_email = email.message_from_string(fetched_email)
self.receiver_addr = parsed['to']
Expand Down

0 comments on commit 7a0ab55

Please sign in to comment.