email

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	MsgType string
	Body    string
}

type Email

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

func New

func New(opts ...Option) *Email

func (*Email) Init

func (e *Email) Init()

func (*Email) Provide

func (e *Email) Provide(ctx context.Context) interface{}

func (*Email) Send

func (e *Email) Send(msg *Message) error

type Message

type Message struct {
	ToAddrs []string
	Cc      []string
	Subject string
	Body    *Body
	Attach  string
}

type Option

type Option func(*Options)

func WithFrom

func WithFrom(from string) Option

func WithHost

func WithHost(host string) Option

func WithPort

func WithPort(port int) Option

func WithPwd

func WithPwd(pwd string) Option

type Options

type Options struct {
	Host string // 邮箱服务地址
	Port int    // 邮箱服务端口
	From string // 邮件发送使用地址
	Pwd  string // 邮件密码
}

Jump to

Keyboard shortcuts

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