python回复邮件_在Python中通过Outlook回复电子邮件(Replying To email via Outlook in Python)...

该博客介绍如何利用Python的win32com库,通过Outlook应用程序自动回复含有特定关键字的邮件。代码示例展示了如何获取收件箱中的最新邮件,检查邮件主题,并在满足条件时创建并发送回复邮件。
摘要由CSDN通过智能技术生成

I am trying to reply to emails with a keyword in the subject but I need to do it all through outlook. My current code works decently but it would be better if it could reply directly instead of creating a new message.

Hopefully this is the right place to ask this :)

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")

o = win32com.client.Dispatch("Outlook.Application")

inbox = outlook.GetDefaultFolder(6)

def check_mail():

global message

messages = inbox.Items

message = messages.GetLast()

if (message.subject.find('@Bot') != -1 and message.unread and whtlist.find(message.SenderName)!= -1 ):

return 1

else:

return 0

def Read_mail():

global message

global ACTIVE

body_content = message.body

print(bcolors.WARNING

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值