We can send email by outlook with filling all details by python code. and we can implement send email functionality in our project easily.
First we have to give details like from, to subject and attachment then this all details will be filled in outlook with python code. please see the below code.
First we have to give details like from, to subject and attachment then this all details will be filled in outlook with python code. please see the below code.
import win32com.client from win32com.client import Dispatch, constants
const=win32com.client.constants olMailItem = 0x0 obj = win32com.client.Dispatch("Outlook.Application") newMail = obj.CreateItem(olMailItem) newMail.Subject = "I AM SUBJECT!!" newMail.Body = "I AM IN THE BODY\nSO AM I!!!" newMail.To = "abc@abc.com" attachment1 = r"E:\test\logo.png" newMail.Attachments.Add(Source=attachment1) newMail.display() #newMail.send()