HTML tag, <details/> and <summary/> not working in outlook
jack
10
Reputation points
i am trying to send a HTML body as an email. i am using <details> and <summary> tag to create a dropdown. but i am not able to see the dropdown in outlook desktop app.
here is the code i am using
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
me = ""
you = ""
# Create message container - the correct MIME type is multipart/alternative.
msg = MIMEMultipart("alternative")
msg["Subject"] = "Link"
msg["From"] = me
msg["To"] = you
# Create the body of the message (a plain-text and an HTML version).
html = """\
<html>
<body>
<details>
<summary>Details</summary>
<ol>
<li>data</li>
<li>other data</li>
</ol>
</details>
</body>
</html>
"""
# Record the MIME types of both parts - text/plain and text/html.
part2 = MIMEText(html, "html")
# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this case
# the HTML message, is best and preferred.
msg.attach(part2)
# Send the message via local SMTP server.
s = smtplib.SMTP("", 25)
# sendmail function takes 3 arguments: sender's address, recipient's address
# and message to send - here it is sent as one string.
s.sendmail(me, you, msg.as_string())
s.quit()
The result i got
the result i am trying to achieve,(the arrow mark and collapsable content.
i know that outlook uses microsoft word engine to render HTML, is there any other way to achieve this?
please my boss is going to fire me if i don't get this done
i'm on
Microsoft® Outlook® for Microsoft 365 MSO (Version 2408 Build 16.0.17928.20114) 64-bit
Sign in to answer