我使用 GAE-mail 接收電子郵件,在電子郵件句柄中,我能夠從 mail_message 接收正文、發件人、主題等。
mail_message = mail.InboundEmailMessage(data)
# supported attributes is=>{
'amp_html',
'attachments',
'bcc',
'body',
'cc',
'headers',
'html',
'reply_to',
'sender',
'subject',
'to'
}
但是,我想要一些額外的屬性,email_size 和 senddate,獲得這兩個屬性的最佳實踐是什么?
提前致謝
uj5u.com熱心網友回復:
- Python2 的郵件 API具有以下欄位;它應該適用于 Python3
date 回傳訊息日期。
- This sample code from Google shows length of the message. If you want the size in bytes, you should try
getsizeofmethod instead oflen. See this example
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/445750.html
標籤:python-3.x 电子邮件 谷歌应用引擎
