title: python send plotly chart (div) as email content
body: <p>Im using plotly to create a chart and return div. I want to input div into the html  and send as an email.</p>
  
  <pre><code>div = plotly.offline.plot(data, include_plotlyjs=False, output_type='div')
  </code></pre>
  
  <p>here is the code:</p>
  
  <pre><code> mail_msg = f'''
              &lt;p style="font-weight:bold;"&gt;\n\t &lt;font="Times New Roman"&gt;&lt;font size="2"&gt;This Month：&lt;/font&gt;&lt;/p&gt;
              &lt;p&gt;{table_predict_html}&lt;/p&gt;
              &lt;p style="font-weight:bold;"&gt;\n\t &lt;font="Times New Roman"&gt;&lt;font size="2"&gt;Contrast：&lt;/font&gt;&lt;/p&gt;
              &lt;p&gt;{tot_html}&lt;/p&gt;
              &lt;p style="font-weight:bold;"&gt;\n\t &lt;font="Times New Roman"&gt;&lt;font size="2"&gt;Revenue：&lt;/font&gt;&lt;/p&gt;
              &lt;script src=“https://cdn.plot.ly/plotly-latest.min.js”&gt;&lt;/script&gt;
              &lt;p&gt;{div}&lt;/p&gt;
              '''
   msg.attach(MIMEText(mail_msg, 'html', 'utf-8'))
  </code></pre>
  
  <p>table_predict_html and tot_html are tables in html. Tables displayed in the email but it's all blank for the chart. So what is the proper way of inserting the div to html?</p>
  
  <p>Thanks</p>