'outlook does not send the email I want to send. why?
whenever I run this function I can see only the print result of time and date. the lines below do not get executed nor they throw any error. what is the issue? here is my code.
import win32com.client as win32
def send_email_notification(location):
print(location)
# Setting up Time variables
now = datetime.datetime.now()
date_now = now.strftime("%Y%m%d")
time_now = now.strftime("%H_%M_%S")
print(now,date_now,time_now)
outlook = win32.Dispatch('Outlook.Application')
mail = outlook.CreateItem(0)
mail.Display()
mail.To = '''[email protected]'''
mail.Subject = 'sub'
mail.Body = f"body {time_now}. Please see {location}"
mail.Send()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
