smtp

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Send(ctx context.Context, msg *converter.Message) (int, error)
	Close() error
}

Client exposes the methods of the SMTP client

func New

func New(addr string, logger zerolog.Logger) Client

New creates a new Go native SMTP client

type SMTP

type SMTP struct {
	// contains filtered or unexported fields
}

SMTP wraps SMTP email sending

func (*SMTP) Close

func (s *SMTP) Close() error

Close terminates the SMTP connection

func (*SMTP) Send

func (s *SMTP) Send(ctx context.Context, msg *converter.Message) (int, error)

Send sends given messsage and returns the number accepted recipients by the server. One transaction is executed for the combination of To+Cc while it will create one extra transaction for reach Bcc recipient.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL