我正在嘗試發送系統生成的電子郵件,其中包括電子郵件正文中的圖像。我收到一個「紅X」,而不是像在與下面的HTML發送消息:如何在HTML電子郵件正文中嵌入圖像
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test Mailing</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p>
Text right before the HP image.</p>
<p>
<img alt="Harry Potter" src="data:image/jpeg;base64, /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCABkAJoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn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UUUUAf/Z"/>
</p>
<p>
Text right after the image.</p>
<p>
</p>
</body></html>
通過上述HTML,我得到了我的郵箱以下內容:
文本右前惠普圖片。
哈利波特
文字在圖像後面。
當我檢查我的Gmail內容,我顯示如下內容:
<div><p>
Text right before the HP image.</p>
<p>
<img alt="Harry Potter">
</p>
<p>
Text right after the image.</p>
<p>
</p>
</div>
的「ALT」似乎被保留,但「SRC」似乎變得莫名其妙地下降。
作爲一個測試,我試圖發送一個電子郵件,從服務器檢索圖像。下面的代碼會產生預期的結果,但它是與鏈接的,而不是嵌入的圖像。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test Mailing</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p>
Text right before the Oracle image.</p>
<p>
<img src="http://oracle-base.com/images/site_logo.gif" /></p>
<p>
Text right after the image.</p>
<p>
</p>
</body></html>
我假設我的問題是與IMG標籤,但IMG似乎遵循我在網上看到的例子就嵌入圖像。
感謝您關注此事。
Hi Adobe。非常感謝你看這個。我很感激幫助。我嘗試刪除逗號後的空白,並且仍然只是在電子郵件正文中顯示ALT文本(無圖像)。 – user3138025
@ user3138025:這很奇怪。我使用Gmail。我把它發給自己兩次:一次是空間,另一次沒有空間。沒有空間的人顯示圖像。確定它不適合你? – Adobe