Python imaplib fetch body emails gmail

前端 未结 4 979
长发绾君心
长发绾君心 2020-12-14 23:27

I read this already and wrote this script to fetch body for emails in some mail box which title begins with \'$\' and is sent by some sender.

import email, g         


        
4条回答
  •  抹茶落季
    2020-12-15 00:06

    You can get the contents of the body by doing any of the following

    msg.as_string()
    str(msg)
    repr(msg)
    

    http://docs.python.org/2.7/library/email.message.html#email.message.Message

提交回复
热议问题