【发布时间】:2016-05-24 11:11:06
【问题描述】:
如果我的 HTML 内容包含图像且未显示,我想发送一封包含发送的 HTML 电子邮件的电子邮件,该电子邮件与 cons 的文本相得益彰。 另外如果我尝试查看本地图片中的HTML模板是否正确显示。 如何在 HTML 内容中显示图片?
HTML 内容
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<style>
body{
background-color: gray;
color: red;
}
div, #globale{
background-color:#eee;
}
</style>
</head>
<body>
<!--<img src=" {% static "Kamal.png" %}" alt="image"/>-->
<!-<img src="{% static "Kamal.png" %}" alt="image"/>-->
<div id="globale">
<p>
Convert the filename, content, mimetype triple into a MIME attachment
object. Adjust headers to use Content-ID where applicable.
Taken from <img src="Kamal.png" alt=" Mon Image "/>
HTML is the method of choice for those wishing to send emails with rich
text, layout and graphics. Often it is desirable to embed the graphics
within the message so recipients can display the message directly,
without further downloads.
<img src="{% static "Kamal.png" %}" alt=" Mon Image "/>
Some mail agents don't support HTML or their users prefer to receive
plain text messages. Senders of HTML messages should include a plain
text message as an alternate for these users.
<img src="Kamal.png" />
This recipe sends a short HTML message with a single embedded image
and an alternate plain text message.
</p>
<h3>Message Reussi avec Image</h3>
</div>
</body>
</html>
【问题讨论】:
-
你的
STATIC_URL变量中有什么? -
在我的 STATIC_URL 变量中我有这个 STATIC_URL = '/static/'