实例:def read_mail(username, password):
with Imbox('imap.163.com', username, password, ssl=True) as box:
all_msg = box.messages(unread=True)
for uid, message in all_msg:
# 如果是手机端发来的远程控制邮件
if message.subject == 'Remote Control':
# 标记为已读
box.mark_seen(uid)
return message.body['plain'][0]
地方官梵蒂冈梵蒂冈规范化规范化:
def read_mail(username, password):
with Imbox('imap.163.com', username, password, ssl=True) as box:
all_msg = box.messages(unread=True)
for uid, message in all_msg:
# 如果是手机端发来的远程控制邮件
if message.subject == 'Remote Control':
# 标记为已读
box.mark_seen(uid)
return message.body['plain'][0]
用if-elif 判断并打印结果: 小结 |