smtp

package
v0.0.0-...-2508787 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

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

type Body

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

type Client

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

func NewClient

func NewClient(logger *slog.Logger, config ClientConfigReader) (*Client, error)

func (*Client) SendEmail

func (c *Client) SendEmail(ctx context.Context, msgs ...Msg) error

type ClientConfig

type ClientConfig struct {
	ResendAPIKey string
}

type ClientConfigReader

type ClientConfigReader interface {
	Read(ctx context.Context) (*ClientConfig, error)
}

type Config

type Config struct {
	Auth                  smtp.Auth
	StartTLS              bool
	TLSInsecureSkipVerify bool
}

type Email

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

func NewEmail

func NewEmail() (*Email, error)

func (*Email) AddAttachment

func (e *Email) AddAttachment(filename string, r io.Reader) error

func (*Email) AddBcc

func (e *Email) AddBcc(addresses string) error

func (*Email) AddBody

func (e *Email) AddBody(contentType, content string) error

func (*Email) AddCc

func (e *Email) AddCc(addresses string) error

func (*Email) AddReplyTo

func (e *Email) AddReplyTo(addresses string) error

func (*Email) AddTo

func (e *Email) AddTo(addresses string) error

func (*Email) Send

func (e *Email) Send(addr string, config *Config) error

func (*Email) SetFrom

func (e *Email) SetFrom(from string) error

func (*Email) SetSubject

func (e *Email) SetSubject(subject string) error

type Mailer

type Mailer interface {
	SendEmail(ctx context.Context, msgs ...Msg) error
}

type Msg

type Msg struct {
	From    string
	ReplyTo []string
	To      []string
	Cc      []string
	Bcc     []string
	Subject string
	Plain   string
	HTML    string
}

type ResendMsg

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

Jump to

Keyboard shortcuts

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