stop warning of outlook when sending mail from python
Asked Answered
B

1

0

I am able to send email using following code :

import win32com.client
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "My Subject"
newMail.Body = "My Body"
newMail.To  = "[email protected]"
newMail.send()

But when It sends email, a warning is generated by outlook "A program is trying to send Email..." How to disable such kind of warnings ? Please help..

Bobinette answered 15/1, 2015 at 11:3 Comment(1)
Does this answer your question? How can I avoid Outlook's security warning when sending email programmatically?Goodrich
C
1

You see a standard Outlook security prompt. There are few possible ways to avoid or supress the security dialog:

  1. Use the low-level API for sending emails - Extended MAPI (Messaging API). You may consider Outlook as a big wrapper around that API.
  2. Use any third-party wrapper around the low-level API described in #1.
  3. Use the Outlook security manager component (commercial) designed and developed exactly for supressing such warnings.

It is up to you which way is to choose. Read more about possible workarounds in the Outlook "Object Model Guard" Security Issues for Developers page.

Comstock answered 15/1, 2015 at 11:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.