Choosing “From” field using python win32com outlook

删除回忆录丶 提交于 2019-12-11 03:06:32

问题


I am trying to automate emails using python. Unfortunately, the network administrators at my work have blocked SMTP relay, so I cannot use that approach to send the emails (they are addressed externally).

I am therefore using win32com to automatically send these emails via outlook. This is working fine except for one thing. I want to choose the "FROM" field within my python code, but I simply cannot figure out how to do this.

Any insight would be greatly appreciated.


回答1:


If you configured a separate POP3/SMTP account, set the MailItem.SendUsingAccount property to an account from the Namespace.Accounts collection.

If you are sending on behalf of an Exchange user, set the MailItem.SentOnBehalfOfName property



来源:https://stackoverflow.com/questions/24454538/choosing-from-field-using-python-win32com-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!