473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 3422
Rabbit
12,516 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

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

Similar topics

3
by: Gaurav | last post by:
hello, i am using a perl script to generate html and java script. java script in html file runs fine on some computer but not on others. I have tried various OS with IE 6.0 and 5.0 can...
4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
4
by: funcSter | last post by:
Hey, got a prob which is driving me nuts! I'm trying to resize the resolution of an image as well as it's pyhsical byte size. I've got: byte bytImage = null; System.Drawing.Image imgImage =...
0
by: Dan Morrissey | last post by:
I'm trying to initiate an email with predetermined Subject and HTML formatted body that will allow the user to select the recipients from their own address book. The problem is that I can't seem...
2
by: Fabio Negri Cicotti [MCP] | last post by:
Hi all. How do I do to display a picture on e-mail's body when visualized using Outlook Express? I've set the properties bellow but till now I've got the image shown as that box with a red...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
0
by: shaolinman829 | last post by:
My collegue and I are at the point of pulling our hair out. I'm currently writting a little piece of Java code to send an email confirmation page that sends both html and text. Not a problem. In my...
2
daJunkCollector
by: daJunkCollector | last post by:
Hi, I am creating a mini website that allows a User1 to fill out a form. I need the completed fields to then appear on a second page, protected by a login, to await approval (by User2) before...
3
by: Michael R | last post by:
Hello all. I created an Image field in a table. I set it to be an OLE Object data type. Later I viewed the table in datasheet view and insereted an image to each row of the Image field. Then I...
6
by: Mark B | last post by:
This is sending a blank image with an HTML email. Any ideas why? Is MemoryStream the wrong type of object? Dim ms As MemoryStream = New MemoryStream bmp.Save(ms, ImageFormat.Png) Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.