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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rettla
    New Member
    • Jan 2012
    • 28

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

    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

    Code:
    Dim Mailer
    Dim objCommand
    Set Mailer = Server.CreateObject("CDO.Message")
    Mailer.MimeFormatted = True
    Mailer.To = "you@yourdomain.com"
    Mailer.From = "you@yourdomain.com"
    Mailer.Subject = "Updates to notes"
    Mailer.HTMLBody = "<html><img src=""cid:personimage.jpg""></html>"
    
    Set objCommand = Mailer.AddRelatedBodyPart(Server.MapPath("../images/personimage.jpg"), "personimage.jpg", CdoReferenceTypeName)
    
    
    objCommand.Fields.Item("urn:schemas:mailheader:Content-ID") = "<personimage.jpg>"
    objCommand.Fields.Update
    
    Mailer.Send
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Code:
    <img src="someimage.jpg" height="20px" width="20px">

    Comment

    • Rettla
      New Member
      • Jan 2012
      • 28

      #3
      Hi Rabbit, I tried that and it is not working

      Comment

      Working...