Compartilhar via


Propriedade Mail

Gets the Microsoft SQL Mail service associated with the instance of SQL Server.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)

Sintaxe

'Declaração
<SfcObjectAttribute(SfcObjectRelationship.Object, SfcObjectCardinality.One)> _
Public ReadOnly Property Mail As SqlMail
    Get
'Uso
Dim instance As Server
Dim value As SqlMail

value = instance.Mail
[SfcObjectAttribute(SfcObjectRelationship.Object, SfcObjectCardinality.One)]
public SqlMail Mail { get; }
[SfcObjectAttribute(SfcObjectRelationship::Object, SfcObjectCardinality::One)]
public:
property SqlMail^ Mail {
    SqlMail^ get ();
}
[<SfcObjectAttribute(SfcObjectRelationship.Object, SfcObjectCardinality.One)>]
member Mail : SqlMail
function get Mail () : SqlMail

Valor da propriedade

Tipo: Microsoft.SqlServer.Management.Smo.Mail. . :: . .SqlMail
A SqlMail object that specifies the SQL Mail service associated with the instance of SQL Server.

Exemplos

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server()
'Define the Database Mail service with a SqlMail object variable and reference it using the Server Mail property.
Dim sm As SqlMail
sm = srv.Mail
'Define and create a mail account by supplying the Database Mail service, name, description, display name, and email address arguments in the constructor.
Dim a As MailAccount
a = New MailAccount(sm, "AdventureWorks Administrator", "AdventureWorks Automated Mailer", "Mail account for administrative e-mail.", "dba@Adventure-Works.com")
a.Create()