Hi all
I am trying to send invoices by email. The main text works fine by building up an HTML string using all the fonts and spacing required.
My problem is inserting a company logo at the top. It is being sent as an attachment and not inserted into the body of the email. Extracts of the code follow.
followed by more code to build up the string Ebody. Then at the end I have the following code.
Can anybody tell me why the image is being attached instead of embedded?
Thanks
I am trying to send invoices by email. The main text works fine by building up an HTML string using all the fonts and spacing required.
My problem is inserting a company logo at the top. It is being sent as an attachment and not inserted into the body of the email. Extracts of the code follow.
Code:
Ebody = "<table width ='100%' style = 'font-size:small'>"
Ebody=Ebody + "<tr><td colspan='6' align='center'><img src=""cid:myimage.gif"" width='325' height='80' alt='Logo' /></td></tr>"
followed by more code to build up the string Ebody. Then at the end I have the following code.
Code:
Set myMail = server.CreateObject("CDO.Message")
myMail.MimeFormatted = True
myMail.From = companyRS("Email")
myMail.To = bookingRS("Email")
myMail.Subject = "Your Invoice from " & companyRS("Company_Name")
Set objBP = myMail.AddRelatedBodyPart(Server.MapPath("logo012.gif"), "myimage.gif", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<logo012.gif>"
objBP.Fields.Update
myMail.htmlBody = Ebody
myMail.Send
Set myMail = Nothing
Can anybody tell me why the image is being attached instead of embedded?
Thanks