My aim is to make a newsletter, therefor I need a picture to go a long with the mail I am creating from a mailinglist. When I am opening my mail I dont get my picture but a "picture icon" (the one you get when you place a picture on a webside without a file reference). and I also get "many many" characters/letters, so it seems that the source code finds the picture but is having problems translating it through Email.
What could be the problem ? maybe version of Jmail ? the source code?
the code is like this....
Expand|Select|Wrap|Line Numbers
- ' Først må vi hente en og en adresse fra Mailinglista
- Do until mailRS.EOF
- fromWho = "post@golfXperten.no"
- toWho = mailRS( "mail_address" )
- response.write towho
- ' Her lages mailen
- Set JMail = Server.CreateObject ("JMail.SMTPMail")
- ' reference to the image in the HTMLBody.
- contentId = JMail.AddAttachment(System.AppDomain.CurrentDomain.BaseDirectory() & "tilbud1.jpg", True, "image/jpeg")
- JMail.ContentType = "text/html"
- ' Below you should enter your own SMTP-server
- JMail.ServerAddress = "smtp.cliche.no"
- bilde = JMail.AddAttachment(Server.MapPath("/imagestilbud/tilbud1.jpg"))
- JMail.Sender = fromWho
- JMail.Subject = "Tilbudsmail"
- JMail.AddRecipient toWho
- strContents = "<html><body><font color=""red"">Hi, here is a nice picture:</font><br><img src=""cid:" & contentId & """><br><br>good one huh?</body></html>"
- jm.HTMLBody = strContents
- 'JMail.body = "<HTML><BODY BGCOLOR=""#aaaaaa"" TEXT=""#000000"">Hello world</BODY></HTML>"
- 'JMail.htmlbody = "<img src=" & bilde & ">"
- JMail.Priority = 3
- JMail.Charset = "ISO-8859-1"
- JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
- JMail.Execute
- Set JMail = Nothing
- mailRS.MOVENEXT
- response.write " ---- "
- LOOP
- mailRS.close
- SET mailRS = nothing