You can make a daily report template from this site, I can't put today's date in the subject line ** automatically **!
I want you to automatically create a daily report email! I thought, I put it into practice
import win32com.client
import datetime
#send e-mail
object = win32com.client.Dispatch("Outlook.Application")
mail = object.CreateItem(0)
mail.BodyFormat = 1
#Destination setting To,CC,Bcc
mail.To = "[email protected]"
# mail.cc = "[email protected]"
# mail.Bcc = "[email protected]"
#Get today's date
today = datetime.datetime.now()
#Email subject
mail.Subject = "Daily report[{}Month{}Day]".format(today.month,today.day)
#Email body
mail.Body = """\
thank you for your hard work.
I will send you a daily report.
<What I did>
<What I found>
<What to do next>
that's all
"""
#View the created email
mail.Display(True)
#send e-mail
# mail.Send()
--I was able to compose an email!
I was able to automatically create a daily report email!
To be able to call the mail template (Outlook) [Python] Send email with outlook
Recommended Posts