Using python to send hourly reports in HTML. You must turn on the mouse over the text, in other words, when the user hovers over the report title, certain text is displayed.
Tried the following, but it works when you read emails in Outlook:
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def send_html_email(msg_to_list, msg_from, msg_subject, msg_body, smtp_server):
''' set the subject, To, From and body of the email and send it '''
msg = MIMEMultipart('multipart')
msg['Subject'] = msg_subject
msg['From'] = msg_from
msg['To'] = ', '.join(msg_to_list)
part = MIMEText(msg_body, 'html')
msg.attach(part)
s = smtplib.SMTP(smtp_server)
s.sendmail(msg['From'], msg_to_list, msg.as_string())
s.quit()
title = 'display this when user moves mouse over this header'
html_msg_body = '''<html><body><div align = "center">'''
html_msg_body += '''<br><br><h3 bgcolor="#00BFFF" title=%s>Stats</h3>'''%(title)
html_msg_body += '<br></body>'
html_msg_body += '<br></html>'
msg_body = html_msg_body
msg_to_list = ['me@test.com']
msg_from = 'me@test.com'
msg_subject = "Stats"
smtp_server = 'localhost'
send_html_email(msg_to_list, msg_from, msg_subject, msg_body, smtp_server)
Any help on what needs to be done to make Outlook display text above text?
source
share