'增加一个普通附件 JMail.AddAttachment(Server.MapPath("images/email.gif")) '增加一个嵌入式附件 ' The return value of AddAttachment is used as a ' reference to the image in the HTMLBody. 'contentId = JMail.AddAttachment(Server.MapPath("images/email.gif")) Dim contentId contentId = JMail.AddAttachment("E:\images\email.gif")
'只有HTML格式支持嵌入图片附件,我们采用HTML格式的邮件内容 ' As only HTML formatted emails can contain inline images ' we use HTMLBody and appendHTML JMail.HTMLBody = "<html><body><font color=""red"">Hi, here is a nice picture:</font><br>" JMail.appendHTML "<img src=""cid:" & contentId & """>"