问题
I have the following code
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()
I have two accounts in outlook and i installed redemption too, but struck how to switch account
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
回答1:
Set MailItem.SendUsingAccount
property.
来源:https://stackoverflow.com/questions/52202852/need-to-switch-accounts-in-outlook-using-python-for-sending-email-using-other-ac