mail

package
v0.0.0-...-e80bbde Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerHost = "smtp.qq.com" // 邮件服务器
	Port       = 465           // SMTP 协议默认使用25, qq使用465
	User       = "xxxx@qq.com" // 发送者
	Password   = ""            // 密码

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	From     string   // 发送人
	To       []string // 发送给谁
	Subject  string   // 标题
	Body     string   // 主体内容
	Attach   string   // 附件文件路径
	MailType string   //文件类型
}

func (*Mail) SendMail

func (s *Mail) SendMail() (err error)

发送邮件 form 发送人 to 发送给谁 subject 标题 body 主体内容 attach 附件文件地址

func (*Mail) SetMailType

func (s *Mail) SetMailType(t string)

设置发送邮件的邮件类型 text/html & text/plain

Jump to

Keyboard shortcuts

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