Rediger

Del via


EmbeddedMailObject Class

Definition

Represents an item to embed in an email message constructed using the MailDefinition class.

public ref class EmbeddedMailObject sealed
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.EmbeddedMailObject+EmbeddedMailObjectTypeConverter))]
public sealed class EmbeddedMailObject
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.EmbeddedMailObject+EmbeddedMailObjectTypeConverter))>]
type EmbeddedMailObject = class
Public NotInheritable Class EmbeddedMailObject
Inheritance
EmbeddedMailObject
Attributes

Remarks

The EmbeddedMailObject represents an item to embed in a mail message. These embedded items can be image files such as company logos. Each embedded item is specified by an identifier and a path.

To ensure that an embedded object is displayed correctly within the email message file, the following conditions must be met:

  • The mail message is in HTML format.

  • The item is an image file (.jpg, .gif, .bmp, and so on).

  • The HTML-formatted body file specified in the BodyFileName property contains a reference to the image file using the following syntax:

    <img src="cid:identifier" alt="Alternate Text" />.
    

If an EmbeddedMailObject is added to a mail message and does not fulfill all of the requirements specified previously, it will most likely be displayed as an attachment in the mail message. If an item is referenced by an identifier in the mail message but not included as an embedded item, it will appear as a broken attachment when the mail is viewed.

The EmbeddedMailObjectsCollection stores a collection of EmbeddedMailObject objects for a single mail message. The EmbeddedMailObjectsCollection is used by the EmbeddedObjects property of the MailDefinition object to create the mail message.

Mail messages that allow embedded objects are configurable in the following Web controls by setting their MailDefinition properties declaratively:

Note

The values in the EmbeddedMailObject and EmbeddedMailObjectsCollection objects are not stored in view state. This protects against malicious users discovering path information for your server.

Constructors

EmbeddedMailObject()

Initializes a new instance of the EmbeddedMailObject class.

EmbeddedMailObject(String, String)

Initializes a new instance of the EmbeddedMailObject class, using the specified identifier name and path to populate the object.

Properties

Name

Gets or sets the name that is used as the identifier of the item to be embedded in a mail message constructed with the MailDefinition class.

Path

Gets or sets the path that is used to retrieve an item to embed in a mail message constructed with the MailDefinition class.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also