email

package
v0.0.0-...-8a49cb0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 7 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 {
	Attach(r io.Reader, filename string, c string) (a *email.Attachment, err error)
	SendWithStartTLS(addr string, a smtp.Auth, t *tls.Config) error
}

type Email

type Email struct {
	From        string
	To          []string
	Subject     string
	HTML        []byte
	Attachments []*email.Attachment
}

type Helper

type Helper struct {
	Client
	Options
}

func NewHelper

func NewHelper(opts ...Option) *Helper

func (*Helper) Send

func (h *Helper) Send() error

type Option

type Option func(*Options)

func EmailAttachments

func EmailAttachments(attachments []*email.Attachment) Option

func EmailFrom

func EmailFrom(from string) Option

func EmailHTML

func EmailHTML(html []byte) Option

func EmailSubject

func EmailSubject(subject string) Option

func EmailTo

func EmailTo(to []string) Option

func RetryMaxWaitTime

func RetryMaxWaitTime(t time.Duration) Option

func RetryWaitTime

func RetryWaitTime(t time.Duration) Option

func SenderHost

func SenderHost(host string) Option

func SenderPassword

func SenderPassword(password string) Option

func SenderPort

func SenderPort(port string) Option

func SenderUsername

func SenderUsername(username string) Option

type Options

type Options struct {
	Email
	Sender
	Retry
}
var (
	Opts *Options
)

type Retry

type Retry struct {
	Count       int
	WaitTime    time.Duration
	MaxWaitTime time.Duration
}

type Sender

type Sender struct {
	Host     string
	Port     string
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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