https://www.pdfgear.com/download/
Sherman IT
16 November 2024
03 November 2024
14 September 2024
How to make a bootable flash drive of Win Tool
http://www.downcc.com/soft/247971.html
http://www.downcc.com/tech/1245.html
18 August 2024
28 June 2024
How to send Outlook email with Python
> pip install pywin32
import win32com.client
inbox = win32com.client.gencache.EnsureDispatch("Outlook.Application").GetNamespace("MAPI")
# print(dir(inbox))
inbox = win32com.client.Dispatch("Outlook.Application")
# print(dir(inbox))
mail = inbox.CreateItem(0x0)
mail.To = "testTo@test.com"
mail.CC = "testcc@test.com"
mail.BCC = "testcc@test.com"
mail.Subject = "Send TEST"
mail.Body = "This is the body"
mail.Attachments.Add(u"path to attachment")
mail.Send()
print('Email sent successfully.')
Remember that in the attachment to use escape characters on windows systems i.e.
c:\users\me should be c:\\users\\me
Subscribe to:
Posts (Atom)