I am trying to send an email through Outlook 2010 with Python. The email sends properly but I get the following error. What could be causing it:
Error:
newMail.send()
TypeError: 'bool' object is not callable
My 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()
You have a typo in your call, try this:
newMail.Send()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With