内联图像已损坏

时间:2016-09-01 18:22:48

标签: email attachment email-attachments mime mime-message

我正在尝试发送带有内嵌图片的电子邮件。我已经设置了Content-ID并在我的html中添加了<img src="cid:image1@myemail">。图像作为附件正确到达,但邮件客户端显示图像损坏。

我做错了什么?消息的完整来源如下:

Return-Path: <igal@lucee.org>
Received: from 128.149.80.230
        by smtp.googlemail.com with ESMTPSA id i7sm9313707paf.9.2016.09.01.11.15.59
        for <igal@lucee.org>
        (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Thu, 01 Sep 2016 11:15:59 -0700 (PDT)
Date: Thu, 1 Sep 2016 11:15:54 -0700 (PDT)
From: igal@lucee.org
To: igal@lucee.org
Message-ID: <489410968.5.1472753755600.JavaMail.Admin@IS16>
Subject: [Test] LDEV-545 html 5.0.0.200
MIME-Version: 1.0
Content-Type: multipart/mixed; 
    boundary="----=_Part_4_247149912.1472753754816"
X-Mailer: Lucee Mail

------=_Part_4_247149912.1472753754816
Content-Type: multipart/alternative; 
    boundary="----=_Part_3_913848408.1472753754815"

------=_Part_3_913848408.1472753754815
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Text Message

------=_Part_3_913848408.1472753754815
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

Inline Image: <img src="cid:image1@myemail">

------=_Part_3_913848408.1472753754815--

------=_Part_4_247149912.1472753754816
Content-Type: image/jpeg; name=test-image.jpg
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=test-image.jpg
Content-ID: image1@myemail

/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA
AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu
bmV0IDQuMC4xMAAA/9sAQwAKBwcJBwYKCQgJCwsKDA8ZEA8ODg8eFhcSGSQgJiUjICMiKC05MCgq
NisiIzJEMjY7PUBA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xPtXfUV3SzDmk5OO++u+qav6JWMlSsrXOANlf2
iavpC2cdl/aViWtIYp/MG+NAjAHaOSu38iauyeI0a50eHSNRjRZJooJdOMI82Nf4s55XAGOldlij
AznHPrUPGRl8cP6tbqn2XnvrqP2bWzOK0C+trfXtTim1xLd31SULYsYx5pOADyN3J9D2rtqTFLXP
XrKrLmSt/Xoi4x5VYKKKKwKCiiigAooooAKKKKACiiigAooooA//2Q==
------=_Part_4_247149912.1472753754816--

1 个答案:

答案 0 :(得分:0)

我发现了问题。缺少Content-Type: multipart/related;