需要使用python在outlook中切换帐户以使用其他帐户发送电子邮件 [英] Need to switch accounts in outlook using python for sending email using other account

查看:94
本文介绍了需要使用python在outlook中切换帐户以使用其他帐户发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码

import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = 'madanraj.c@sss.com;
mail.Subject = 'Daily Backlog'
mail.Send()

我在outlook里有两个账户,我也安装了兑换,但是想知道如何切换账户

I have two accounts in outlook and i installed redemption too, but struck how to switch account

我看到了 vb 代码,但我无法转换为 python 代码

i saw vb code and i cant convert to python code

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  Debug.Print Account.Name
next

推荐答案

设置 MailItem.SendUsingAccount 属性.

这篇关于需要使用python在outlook中切换帐户以使用其他帐户发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆