www.aspemail.com/manual_04.html
Chapter 3: Attachments Chapter 4 Embedded Im ages Linked vs. Embedded Images Commercial e-mail messages often contain images, graphics and other desi gn elements. When a message is sent in the HTML format, images used in the message body can be either linked or embedded. jpg"> The main advantage of linked images is that the message body remains sma ll. The main disadvantages are that such messages cannot be viewed off- line, and they have a limited lifespan (images on the sender's server m ay be moved, deleted, or the server itself may go offline). Unlike linked images, embedded images are part of the message itself. Th ey are similar to regular attachments, although they use the multipart/ related format, as opposed to multipart/mixed. An embedded image is als o referenced in a message body using an <IMG> tag, but instead of a URL , an image identifier, or Content ID, is used, as follows: <IMG SRC="cid:My-Image-Identifier"> A message with embedded images can be viewed off-line and remains intact over time, as images are permanently attached to the body. A message m ay contain regular attachments and embedded images at the same time. The AddEmbeddedImage Method AspEmail offers support for embedded images via the method AddEmbeddedIm age which takes two arguments: the physical path to an image file, and its Content ID, which is simply an arbitrary string without spaces. If your message contains multiple embedded images, each must be assigned a unique Content ID. gif (included with the compon ent) as the background image for a message (note that here we use the B ACKGROUND attribute of the <BODY> tag instead of <IMG>): ... To make your script more readable, you may choose to place your message body in a separate file and import it into the Body property using the method AppendBodyFromFile which accepts a full path to the text or HTML file containing the message body. A body file may look as follows: <HTML> <HEAD> <STYLE>BODY { COLOR: #427d64;
previous chapter described the method AddAttachment and its "mem ory" counterpart AddAttachmentMem which attaches a file from memory rat her than disk. Like AddAttachment, the AddEmbeddedImage method also has a memory counterpart, AddEmbeddedImageMem, which expects three argumen ts: the file name, Content ID, and memory array containing the binary c ontent of the file. The latter is usually a recordset value containing a file blob, or a memory upload.
|