472,110 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

PROBLEMS with JMAIL - attachment image sent as text

Hi! PLEASE need help!

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
  1. ' Først må vi hente en og en adresse fra Mailinglista
  2.     Do until mailRS.EOF
  3.  
  4.         fromWho = "post@golfXperten.no"
  5.         toWho = mailRS( "mail_address" )
  6.  
  7.         response.write towho
  8.  
  9.         ' Her lages mailen
  10.         Set JMail = Server.CreateObject ("JMail.SMTPMail")
  11.  
  12. ' reference to the image in the HTMLBody.
  13. contentId = JMail.AddAttachment(System.AppDomain.CurrentDomain.BaseDirectory() & "tilbud1.jpg", True, "image/jpeg")
  14.  
  15.         JMail.ContentType = "text/html"
  16.  
  17.          ' Below you should enter your own SMTP-server
  18.            JMail.ServerAddress = "smtp.cliche.no"
  19.  
  20.         bilde = JMail.AddAttachment(Server.MapPath("/imagestilbud/tilbud1.jpg"))
  21.  
  22.           JMail.Sender = fromWho
  23.            JMail.Subject = "Tilbudsmail"
  24.  
  25.           JMail.AddRecipient toWho
  26.  
  27.  
  28.  
  29. 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>"
  30. jm.HTMLBody = strContents
  31.  
  32.         'JMail.body = "<HTML><BODY BGCOLOR=""#aaaaaa"" TEXT=""#000000"">Hello world</BODY></HTML>"
  33.         'JMail.htmlbody = "<img src=" & bilde & ">"
  34.         JMail.Priority = 3
  35.  
  36.         JMail.Charset = "ISO-8859-1"
  37.            JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
  38.            JMail.Execute
  39.         Set JMail = Nothing
  40.  
  41.         mailRS.MOVENEXT
  42.         response.write " ---- "
  43.     LOOP
  44.  
  45.     mailRS.close
  46.     SET mailRS = nothing
Aug 13 '07 #1
0 2270

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by knoak | last post: by
reply views Thread by Lasse Edsvik | last post: by
reply views Thread by Lasse Edsvik | last post: by
reply views Thread by BDKiii | last post: by
8 posts views Thread by Mangler | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.