Class SmtpElement
Represents a configuration element providing SMTP client configuration settings.
Implements
Inherited Members
Namespace: Nevatech.Vsb.Repository.Configuration
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class SmtpElement : ConfigurationElement, IValidator
Constructors
SmtpElement()
Declaration
public SmtpElement()
Properties
ErrorMessage
When implemented, gets the message indicating the errors found during validation process.
Declaration
public string ErrorMessage { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This property should be checked only if Validate() method returns False. If Validate() method returns True, this property should return Null.
FromAddress
Gets or sets the from address for this email message.
Declaration
[ConfigurationProperty("fromAddress")]
public string FromAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Host
Gets or sets the name or IP address of the host used for SMTP transactions.
Declaration
[ConfigurationProperty("host")]
public string Host { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IsConfigured
Gets the flag indicating that SMTP client is fully configured.
Declaration
public bool IsConfigured { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsEnabled
Gets or sets the flag that controls whether a SMTP server should be used for alert notifications.
Declaration
[ConfigurationProperty("enabled")]
public bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
NetworkCredentials
Gets the credentials used to authenticate the sender.
Declaration
[ConfigurationProperty("networkCredentials")]
public UserNameCredentialsElement NetworkCredentials { get; }
Property Value
| Type | Description |
|---|---|
| UserNameCredentialsElement |
OAuthCredentials
Gets the XOAuth2 credentials used to authenticate the sender. If provided then XOAuth2 authentication will be used.
Declaration
[ConfigurationProperty("oauthCredentials")]
public SmtpOAuthElement OAuthCredentials { get; }
Property Value
| Type | Description |
|---|---|
| SmtpOAuthElement |
Port
Gets or sets the port used for SMTP transactions. Default is 25.
Declaration
[ConfigurationProperty("port")]
public int Port { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Properties
Gets collection of configuration element properties.
Declaration
protected override ConfigurationPropertyCollection Properties { get; }
Property Value
| Type | Description |
|---|---|
| ConfigurationPropertyCollection |
Overrides
Timeout
Gets or sets a value that specifies the amount of time (in seconds) after which the Send call times out. Default is 60.
Declaration
[ConfigurationProperty("timeout")]
public int Timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
UseSsl
Gets or sets the flag indicating if the client should make an SSL-wrapped connection to the server. Default is False.
Declaration
[ConfigurationProperty("useSsl")]
public bool UseSsl { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
The property only controls whether or not the client makes an SSL-wrapped connection. In other words, even if the UseSsl parameter is false, SSL/TLS may still be used if the mail server supports the STARTTLS extension.
Methods
Validate()
When implemented, evaluates the state of the object.
Declaration
public bool Validate()
Returns
| Type | Description |
|---|---|
| bool | True if state is valid; otherwise, false. |