Skip to content

EmailOutput Class

Definition

namespace Sharplog.Outputs

public class EmailOutput : AsyncOutput

Object
Output
   AsyncOutput
     EmailOutput

Implements: System.IDisposable

Output sending mails.

Constructors

Name
EmailOutput()
EmailOutput(SmtpClient, MailAddress, MailAddress[], MailAddress[], MailAddress[], int, string, LevelContainer)

Properties

Name Type GET SET
Format string
Levels LevelContainer
SuspendTime int
Client SmtpClient
From MailAddress
To MailAddress[]
Bcc MailAddress[]
CC MailAddress[]
SubjectFormat string

Inherited Methods

Name Modifiers Returns
Write(string, Log) public
Start() public
WriteNonBlocking((string, Log)[]) public
Dispose() public

Constructors

EmailOutput()

public EmailOutput()
    : this(null, null)

Initializes a new instance of the EmailOutput class.

EmailOutput(SmtpClient, MailAddress, MailAddress[], MailAddress[], MailAddress[], int, string, LevelContainer)

public EmailOutput(
    SmtpClient client,
    MailAddress from,
    MailAddress[] to = null,
    MailAddress[] bcc = null,
    MailAddress[] cc = null,
    string formatSubject = "[$La{l}$] $C$",
    int suspendTime = 5000,
    string format = null,
    LevelContainer levels = null)
    : base(suspendTime, format, levels)

Initializes a new instance of the EmailOutput class.

Parameter

client SmtpClient ·
The smtp client.
from MailAddress ·
The email from field.
to MailAddress[] · null
The email to field.
bcc MailAddress[] · null
The email bcc field.
cc MailAddress[] · null
The email cc field.
formatSubject string · "[$La{l}$] $C$"
The format of the subject field.
suspendTime int · 5000
The suspend time between logs in ms.
format string · null
The format.
levels LevelContainer · null
The level settings.

Properties

Client

public SmtpClient Client { get; set; }
Type: SmtpClient

Gets or sets the smtp client.

From

public MailAddress From { get; set; }
Type: MailAddress

Gets or sets the email from field.

To

public MailAddress[] To { get; set; }
Type: MailAddress[]

Gets or sets the email to field.

Bcc

public MailAddress[] Bcc { get; set; }
Type: MailAddress[]

Gets or sets the email bcc field.

CC

public MailAddress[] CC { get; set; }
Type: MailAddress[]

Gets or sets the email cc field.

FormatSubject

public string FormatSubject { get; set; }
Type: string

Gets or sets the format of the subject field.