mailer

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	Host     string
	Port     int
	UserName string
	Password string
	OpenTsl  bool
}

func (*Mailer) TlsDial

func (mail *Mailer) TlsDial(addr string) (*smtp.Client, error)

return a smtp client by TLS connect

type SendMail added in v0.5.7

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

func GetSendMailer

func GetSendMailer(mailOption Mailer) (ret *SendMail, err error)

获取发送邮件对象

func NewMailer

func NewMailer(optionName string) (mailer *SendMail, err error)

func (*SendMail) AddAttachment added in v0.5.7

func (sm *SendMail) AddAttachment(filePath string) (contentId string, err error)

添加附件

func (*SendMail) Bcc added in v0.5.7

func (sm *SendMail) Bcc(bccuser []string) *SendMail

Bcc 添加密送人

func (*SendMail) Cc added in v0.5.7

func (sm *SendMail) Cc(ccuser []string) *SendMail

Cc 添加抄送人

func (*SendMail) From added in v0.5.7

func (sm *SendMail) From(fromuser string) *SendMail

From 添加发送人名称

func (*SendMail) Send added in v0.5.7

func (sm *SendMail) Send(message string) (err error)

发送邮件

func (*SendMail) SetHtml added in v0.5.7

func (sm *SendMail) SetHtml() *SendMail

SetHtml 设置html格式邮件类型

func (*SendMail) SetText added in v0.5.7

func (sm *SendMail) SetText() *SendMail

SetText 设置文本邮件类型

func (*SendMail) SetType added in v0.5.7

func (sm *SendMail) SetType(bodyType string) *SendMail

SetType 设置邮件类型 html/plain

func (*SendMail) Subject added in v0.5.7

func (sm *SendMail) Subject(subject string) *SendMail

Subject添加邮件主题

func (*SendMail) To added in v0.5.7

func (sm *SendMail) To(touser []string) *SendMail

To 添加收件人

Jump to

Keyboard shortcuts

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