0

I need to send an HTML table to outlook via python I tried this code but it isn't working it send an empty mail to me

    msg = MIMEMultipart()
    msg['Subject'] = "subject"
    msg['From'] = "from.com"
    msg['To'] = ', '.join(email_list)
    html = """table border="1" class="dataframe"> 
  <thead> 
    <tr style="text-align: right;"> 
      <th>DG Lead</th> 
    </tr> 
  </thead> 
  <tbody> 
    <tr> 
      <td>Krishnamurthy Ramamurthy</td> 
      <td>324</td> 
> 
    <tr> """
    msg.HTMLBody=html
    s = smtplib.SMTP(SERVER)
    s.sendmail("from.com", email_list, msg.as_string())
    s.quit()
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45

0 Answers0