我需要通过Python发送一个HTML表到Outlook我尝试了这段代码,但它不工作,它给我发送一封空邮件
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()
1条答案
按热度按时间dsekswqp1#
使用Gmail SMTP服务器,这应该对您有效