charlierguo / gmail

A Pythonic interface for Google Mail
MIT License
1.77k stars 385 forks source link

Get Date, Sender info from a message #62

Open GeorgeGkas-zz opened 8 years ago

GeorgeGkas-zz commented 8 years ago

Hello, How is it possible to get the sender Info to a string in format Some Name <someemail@gmail.com>, the date it was sent and if there any other recipients (cc)? I tried the following but it din't worked:

inbox = g.inbox().mail(sender="someone@gmail.com")
for msg in inbox:
                    msg.fetch()
                    print msg.body, msg.subject, msg.date, msg.cc