I want to embed images saved in local directory into an outlook email. Have defined a function to do that and also added the html according. However, the image doesn't come up. Not an issue with the file path as I've already checked that it's working. What did I do wrong?
def Emailer(text, subject, recipient, cc):
import win32com.client as win32
import os
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = recipient
mail.CC = cc
mail.Subject = subject
mail.HtmlBody = text
mail.Display(True)
MailSubject = "Daily Report for " + date_slash
MailInput ="""
<div>
<img src={}></img>
</div>
<div>
<p>
</div>
<div>
<img src={}></img>
</div>
<div>
<p>
</div>
<div>
<img src={}></img>
</div>
<div>
<p>
</div>
<div>
<img src={}></img>
</div>
<div>
<p>
</div>
<div>
<img src={}></img>
</div>
"""
MailInput = MailInput.format(date_slash, sum_path, ovdv_path, cot_path, rub_path ,pnl_path) MailRecipient ="xxx@yyy.com;" MailCc = "xxx@yyy.com;"