如何使用Python在电子邮件中发送HTML内容?我可以发送简单的文字.
如何将变量插入到我用python发送的html电子邮件中?我想要发送的变量是code.以下是我到目前为止的情况.
text = "We Says Thanks!"
html = """\
<html>
<head></head>
<body>
<p>Thank you for being a loyal customer.<br>
Here is your unique code to unlock exclusive content:<br>
<br><br><h1><% print code %></h1><br>
<img src="http://domain.com/footer.jpg">
</p>
</body>
</html>
"""
Run Code Online (Sandbox Code Playgroud)