Export (0) Print
Expand All

Server.Mail Property

 

Applies To: SQL Server 2016 Preview

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

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

<SfcObjectAttribute(SfcObjectRelationship.Object, SfcObjectCardinality.One)>
Public ReadOnly Property Mail As SqlMail

Property Value

Type: Microsoft.SqlServer.Management.Smo.Mail.SqlMail

A SqlMail object that specifies the SQL Mail service associated with the instance of SQL Server.

Legacy Code Example

Visual Basic

Code snippet is not found. Confirm that the code snippet name 'SMO How to' is correct.

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$sm = $srv.Mail
$a = new-object Microsoft.SqlServer.Management.Smo.Mail.MailAccount($sm, "Adventure Works Administrator", "AdventureWorks2012 Automated Mailer", "Mail account for administrative e-mail.", "dba@Adventure-Works.com")
$a.Create()
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft