SmtpServerCollectionAdd Method (String, Int32, Int32, Int32, Boolean, AuthenticationMethods, String, String, Boolean, String, ExtendedSmtpOptions)
Initializes a new instance of the SmtpServer class with the given parameter values, adds this instance to the collection, and sorts the collection according to the elements priorities.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public SmtpServer Add(
	string serverName,
	int serverPort,
	int priority,
	int timeout,
	bool pipelining,
	AuthenticationMethods authMethods,
	string accountName,
	string password,
	bool allowRefusedRecipients,
	string helloDomain,
	ExtendedSmtpOptions smtpOptions


Type: SystemString
The host name or IP address of the SMTP relay server.
Type: SystemInt32
The port on which to communicate with the SMTP relay server. The standard SMTP port is 25.
Type: SystemInt32
A preference of the SMTP relay server. Lower values are preferred.
Type: SystemInt32
The amount of time (in milliseconds) the component will wait for data to be received from the server before returning an error, or zero to wait indefinitely.
Type: SystemBoolean
Specifies whether to use commands pipelining (ESMTP PIPELINING) if it's supported by the server.
Type: MailBeeAuthenticationMethods
A set of authentication methods which can be used when authenticating the user on the server.
Type: SystemString
The user account name on the server.
Type: SystemString
The user account password on the server.
Type: SystemBoolean
Specifies whether refused recipients should be allowed when submitting a mail message to the server.
Type: SystemString
The string to be supplied as an argument of HELO/EHLO commands, or a null reference (Nothing in Visual Basic) to let MailBee autodetect the correct value (see Hello for details).
Type: MailBee.SmtpMailExtendedSmtpOptions
A set of flags which can be used to disable certain extended SMTP capabilities.

Return Value

Type: SmtpServer
A reference to SmtpServer object which was created based on the given parameter values and then added to the collection.
MailBeeInvalidArgumentExceptionserverName is a null reference (Nothing in Visual Basic) or serverPort is an invalid port number.
See Also