RosettaCodeData/Task/Send-email/Python/send-email-3.py

14 lines
306 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import win32com.client
def sendmail(to, title, body):
olMailItem = 0
ol = win32com.client.Dispatch("Outlook.Application")
msg = ol.CreateItem(olMailItem)
msg.To = to
msg.Subject = title
msg.Body = body
msg.Send()
ol.Quit()
sendmail("somebody@somewhere", "Title", "Hello")