ASP嵌入图像CDO.Message电子邮件 [英] ASP embed image to CDO.Message email
问题描述
我使用ASP经典与CDO送与 CreateMHTMLBody
方法电子邮件。我有几个图片在我的电子邮件其中有些是静态的,不会改变,但他们中的一些会改变基于电子邮件的内容。有些邮件软件一样显示iCloud的照片作为附件,尽管我把它们都用全路径URL地址。我使用 AddRelatedBodyPart
但现在它们显示在你必须但他们仍然显示附件中的图像,以及地方的图像。我想要的图片只是显示在体内的电子邮件没有附件。是否任何一个知道如何解决这一问题?这里是我的code的例子:
I'm using ASP classic and CDO to send email with CreateMHTMLBody
method. I have couple of images in my email which some of them are static and would not change but some of them will change based on email content. Some of the mail softwares like iCloud showing the pictures as attachment even though I have them all with full path url address. I've used AddRelatedBodyPart
but right now they show the images in the place that thy have to be but still they show the images in attachment as well. I want the picture just show in body of email not in attachment. Does any one know how to fix this? Here is the example of my code:
Set myMail=CreateObject("CDO.Message")
myMail.Subject= "Subject of Email"
myMail.From= "from@site.com"
myMail.To= "to@site.com"
myMail.CreateMHTMLBody "http://www.mysite.com/email.html"
strImagePath = Server.MapPath("\") & "\images\mypic1.jpg"
myMail.AddRelatedBodyPart strImagePath, "my_pic_1", 0
strImagePath = Server.MapPath("\") & "\images\mypic2.jpg"
myMail.AddRelatedBodyPart strImagePath, "my_pic_2", 0
myMail.Send
set myMail=nothing
在此先感谢您的时间和帮助。
Thanks in advance for your time and help.
推荐答案
我知道这个问题是旧的,但也许你(或其他人)仍在寻找答案:
I know this question is old but maybe you (or someone else) is still looking for the answer:
myMail.Configuration.Fields("urn:schemas:httpmail:content-disposition-type")="inline"
myMail.Configuration.Fields.Update
这应该引起大多数邮件客户端不渲染图像作为附件。
This should cause most mail clients to not render images as attachments.
这篇关于ASP嵌入图像CDO.Message电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!