email

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DOMAIN 域名
	DOMAIN = "Moon监控系统"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetUser() string
	GetPass() string
	GetHost() string
	GetPort() uint32
}

Config 邮件配置

type Email

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

Email 邮件

func (*Email) Send

func (l *Email) Send() error

Send 发送邮件

func (*Email) SetAttach

func (l *Email) SetAttach(attach ...string) Interface

SetAttach 设置附件

func (*Email) SetBody

func (l *Email) SetBody(body string, contentType ...string) Interface

SetBody 设置邮件正文

func (*Email) SetCc

func (l *Email) SetCc(cc ...string) Interface

SetCc 设置抄送人

func (*Email) SetSubject

func (l *Email) SetSubject(subject string) Interface

SetSubject 设置邮件主题

func (*Email) SetTo

func (l *Email) SetTo(to ...string) Interface

SetTo 设置收件人

type Interface

type Interface interface {
	// Send 发送邮件
	Send() error
	SetTo(to ...string) Interface
	SetSubject(subject string) Interface
	SetBody(body string, contentType ...string) Interface
	SetAttach(attach ...string) Interface
	SetCc(cc ...string) Interface
}

Interface 邮件接口

func New

func New(cfg Config) Interface

New 创建邮件

func NewMockEmail added in v1.0.0

func NewMockEmail() Interface

Jump to

Keyboard shortcuts

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