gemail

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent for mailing

func New

func New(c *Config) (*Agent, error)

New creates new email agent

func (*Agent) Send

func (a *Agent) Send(To []string, From, Subject, Header, Content, Footer string) error

Send sends e-mail by Template

func (*Agent) SendMail

func (a *Agent) SendMail(to []string, subject, content string) error

SendMail 不需要模板发送

type Append

type Append struct {
	Path   string
	Rename string
}

type Config

type Config struct {
	Host     string   //邮箱服务器地址
	Port     string   //邮箱服务器端口号
	Username string   //邮箱账号
	Password string   //邮箱密码
	Secret   string   //todo:秘钥
	FromName string   //模板中使用的用户名,别称
	Template string   //内容模板
	Appends  []Append //附件
}

Jump to

Keyboard shortcuts

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