In my software I have so far opened a new Outlook window like this:
import win32com.client
def open_outlook_new_mail():
outlook = win32com.client.Dispatch("Outlook.Application")
mail = outlook.CreateItem(0)
mail.SentOnBehalfOfName = "[email protected]"
mail.Display(False)
open_outlook_new_mail()
This no longer seems to work with the new Outlook versions. The SentOnBehalfOfName value is no longer making any changes to the Outlook message, although the required authorization is assigned. The behavior occurs since the update to O365 Outlook.
Is there another way to get Outlook to open a new message in which you can set the sender from your own program?
SMTP is out of the question, as in my case the user should be able to edit the message before sending it, add attachments etc.
Thanks for any tips.
BAHbKA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.