Export (0) Print
Expand All

PasswordRecovery::MailDefinition Property

Gets a reference to a collection of properties that define the characteristics of e-mail messages used to send new or recovered passwords to users.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
[ThemeableAttribute(false)]
public:
property MailDefinition^ MailDefinition {
	MailDefinition^ get ();
}

Property Value

Type: System.Web.UI.WebControls::MailDefinition
A reference to a MailDefinition that contains properties that define the characteristics of e-mail messages used to send users their passwords.

The MailDefinition property returns a reference to a group of properties that you use to define format and content of the password e-mail message sent to users. Common settings include the subject line and the sender's return address. For a complete list of properties, see the MailDefinition class.

This property is read-only; however, you can set the properties of the MailDefinition object it returns. You can set these properties declaratively in the form Property-Subproperty, where Subproperty represents a property of the MailDefinition class (for example, MailDefinition-Subject). You can also set the properties programmatically in the form Property.Subproperty (for example, MailDefinition.Subject).

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

When the e-mail message is created from the MailDefinition object, it will make the substitutions shown in the following table. The substitution text is case-insensitive.

Substitution text

Replaced with

<%UserName%>

The Web site user name of the user.

<%Password%>

The recovered password for the user.

If the IsBodyHtml property of the MailDefinition object is true, the contents of the mail message will be HTML encoded to guard against cross-site scripting security vulnerabilities for the message recipient.

The following code example uses the SendingMail event to define the password e-mail message by setting subproperties of the MailDefinition property.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft