# SmtpAppender Class

Module
import { SmtpAppender } from "@tsed/smtp"
Source/packages/smtp/src/SmtpAppender.ts

# Overview

class SmtpAppender extends BaseAppender {
<span class="token function">configure</span><span class="token punctuation">(</span>config<span class="token punctuation">:</span> <a href="/api/logger/appenders/interfaces/PartialAppenderConfiguration.html"><span class="token">PartialAppenderConfiguration</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> this<span class="token punctuation">;</span>
<span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">write</span><span class="token punctuation">(</span>loggingEvent<span class="token punctuation">:</span> <a href="/api/logger/core/LogEvent.html"><span class="token">LogEvent</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">shutdown</span><span class="token punctuation">(</span>complete<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">;</span>
<span class="token keyword">protected</span> <span class="token function">sendBuffer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token keyword">protected</span> <span class="token function">scheduleSend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>

}

# Description

SMTP Appender. Sends logging events using SMTP protocol. It can either send an email on each event or group several logging events gathered during specified interval.

config.sendInterval time between log emails (in seconds), if 0 then every event sends an email config.shutdownTimeout time to give up remaining emails (in seconds; defaults to 5).

# Members

configure(config: PartialAppenderConfiguration): this;

build(): void;

write(loggingEvent: LogEvent): void;

shutdown(complete: any): any;

protected sendBuffer(): void;

protected scheduleSend(): void;

Other topics