interfaces

package
v0.0.0-...-cd4d371 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecipientTo  = "to"
	RecipientCc  = "cc"
	RecipientBcc = "bcc"

	PriorityNormal = "normal"
	PriorityLow    = "low"
	PriorityHigh   = "high"
)

Variables

View Source
var ParseAddress = mail.ParseAddress

Functions

This section is empty.

Types

type Address

type Address = mail.Address

type Attachment

type Attachment struct {
	Name   string
	Inline bool
	Attach io.ReadCloser
}

Attachment 邮箱附件结构体

type Message

type Message struct {
	From         *Address              //发件人
	ReplyTo      *Address              //回复地址
	Recipients   map[string][]*Address //收件地址
	Subject      string                //主题
	TextBody     string                //超文本内容
	HtmlBody     string                //文本内容
	Attachments  []*Attachment         //附件
	Priority     string                //优先级: normal, low, high
	DeliveryTime time.Time             //定时发送
	Tags         []string              //添加标签(某些第三方服务可用的功能)
	Tracking     bool                  //允许追踪(某些第三方服务可用的功能)
}

Message 邮箱消息结构体

func (*Message) AddBcc

func (msg *Message) AddBcc(address ...*Address)

AddBcc 添加秘送收件人

func (*Message) AddCc

func (msg *Message) AddCc(address ...*Address)

AddCc 添加抄送收件人

func (*Message) AddRecipients

func (msg *Message) AddRecipients(recipientType string, address ...*Address)

AddRecipient 添加指定位置的收件人, recipientType: RecipientTo, RecipientCc, RecipientBcc

func (*Message) AddTo

func (msg *Message) AddTo(address ...*Address)

AddTo 添加收件人

func (*Message) SetPriority

func (msg *Message) SetPriority(priority string)

SetPriority 设置优先级

type Sender

type Sender interface {
	Send(ctx context.Context, message *Message) (bizId string, err error)
}

Jump to

Keyboard shortcuts

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