email

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GmailSuffix = "@gmail.com"
	GmailType   = "google"
	GmailHost   = "smtp.gmail.com"
	GmailPort   = 587
	GmailIsSSL  = false
)
View Source
const (
	NetSuffix = "@163.com"
	NetType   = "163"
	NetHost   = "smtp.163.com"
	NetPort   = 465
	NetIsSSL  = true
)
View Source
const (
	QqSuffix = "@qq.com"
	QqType   = "qq"
	QqHost   = "smtp.qq.com"
	QqPort   = 587
	QqIsSSL  = false
)

Variables

This section is empty.

Functions

func DoSend

func DoSend(to, subject, body, from, nickname, secret string) (err error)

DoSend 发送邮件

func SendEmail deprecated added in v1.2.4

func SendEmail(config Email, to []string, subject string, body string) error

Deprecated: DoSend @function: send @description: Email发送方法 @param: subject string, body string @return: error

Types

type Email added in v1.2.4

type Email struct {
	To       string `mapstructure:"to" json:"to" yaml:"to"`                   // 收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用
	From     string `mapstructure:"from" json:"from" yaml:"from"`             // 发件人  你自己要发邮件的邮箱
	Host     string `mapstructure:"host" json:"host" yaml:"host"`             // 服务器地址 例如 smtp.qq.com  请前往QQ或者你要发邮件的邮箱查看其smtp协议
	Secret   string `mapstructure:"secret" json:"secret" yaml:"secret"`       // 密钥    用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥
	Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称    发件人昵称 通常为自己的邮箱
	Port     int    `mapstructure:"port" json:"port" yaml:"port"`             // 端口     请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465
	IsSSL    bool   `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"`       // 是否SSL   是否开启SSL
}

Jump to

Keyboard shortcuts

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