Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Use the inherited Instances property of the SPOutboundMailService class to return an SPServiceInstanceDependencyCollection object that represents all instances of the outbound mail service. Use the SPOutboundMailServiceInstanceCollection constructor to return the collection of outbound mail service instances that are running on a specific server. To add a service instance to the collection, use the Add method of the SPPersistedChildCollection class.
Use an indexer to return a single outbound mail service instance from the collection. For example, if the collection is assigned to a variable named
] in C#, or
) in Visual Basic, where index is either the name or the GUID that identifies the service instance in the collection.