email

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLineLength is the maximum line length per RFC 2045
	MaxLineLength = 76
)

Variables

This section is empty.

Functions

func TrimAddresses

func TrimAddresses(address string) string

TrimAddresses workaround for go < 1.15

Types

type Builder added in v0.0.4

type Builder struct {
	From    *mail.Address
	To      []*mail.Address
	ReplyTo *mail.Address
	Body    string
	Subject string
	// contains filtered or unexported fields
}

Builder builds emails

func (*Builder) AddFile added in v0.0.4

func (b *Builder) AddFile(name string, data io.Reader, contentType string)

AddFile adds a file attachment

func (*Builder) Send added in v0.0.4

func (b *Builder) Send(cfg *SMTPConfig) (err error)

Send sends the email

func (*Builder) WriteAttachments added in v0.0.4

func (b *Builder) WriteAttachments(w io.Writer) (err error)

WriteAttachments streams the attachments

type SMTPConfig added in v0.0.5

type SMTPConfig struct {
	Server       string
	Username     string
	Password     string
	FromOverride *mail.Address
	Helo         string
	InsecureTLS  bool
	NoTLS        bool
	StartTLS     bool
}

SMTPConfig smtp configuration

type SplittingWritter added in v0.0.4

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

SplittingWritter writes a stream and inserts a terminator

func (*SplittingWritter) Write added in v0.0.4

func (w *SplittingWritter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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