468,541 Members | 1,706 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,541 developers. It's quick & easy.

Resizing an embedded image in an automatic HTML email created using classic ASP

28
I am working on a project for a company intranet that requires an automatic HTML e-mail to be sent whenever a new note or an existing note is updated on an person's profile. The email should contain an image of the person. These images are stored on a server. I have managed to do this but problem is the code I have used does not allow me to resize the images to fit the e-mail formatting I have. If I try adding the style and border to the image tag in the code, it does not work. See code below. Any ideas?

Thanks

Expand|Select|Wrap|Line Numbers
  1. Dim Mailer
  2. Dim objCommand
  3. Set Mailer = Server.CreateObject("CDO.Message")
  4. Mailer.MimeFormatted = True
  5. Mailer.To = "you@yourdomain.com"
  6. Mailer.From = "you@yourdomain.com"
  7. Mailer.Subject = "Updates to notes"
  8. Mailer.HTMLBody = "<html><img src=""cid:personimage.jpg""></html>"
  9.  
  10. Set objCommand = Mailer.AddRelatedBodyPart(Server.MapPath("../images/personimage.jpg"), "personimage.jpg", CdoReferenceTypeName)
  11.  
  12.  
  13. objCommand.Fields.Item("urn:schemas:mailheader:Content-ID") = "<personimage.jpg>"
  14. objCommand.Fields.Update
  15.  
  16. Mailer.Send
  17.  
May 2 '12 #1
2 3277
Rabbit
12,513 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. <img src="someimage.jpg" height="20px" width="20px">
May 2 '12 #2
Rettla
28
Hi Rabbit, I tried that and it is not working
May 3 '12 #3

Post your reply

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

Similar topics

3 posts views Thread by Gaurav | last post: by
4 posts views Thread by funcSter | last post: by
reply views Thread by Dan Morrissey | last post: by
2 posts views Thread by Fabio Negri Cicotti [MCP] | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.