【问题标题】:Send html table in outlook mail via Python [duplicate]通过 Python 在 Outlook 邮件中发送 html 表 [重复]
【发布时间】:2017-12-08 16:21:03
【问题描述】:

我有一个代码,它使用 win32com 打开 Outlook 并发送邮件。 我正在尝试将 myexample.html 文件中的表格发送给收件人。 但是,当我使用

msg.body=open('myexample.html').read()

这是我发送的邮件中的内容

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> 

但我想要一个表格视图。 我怎样才能得到它?

【问题讨论】:

标签: html python-2.7 pandas outlook win32com


【解决方案1】:

想出了答案。 只需要改变

msg.body = body

msg.HTMLBody  = body

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-01
    • 2017-04-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多