am_smtp

package
v0.0.0-...-ea654c3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHTMLMail

func SendHTMLMail(
	from string,
	to []string,
	subject string,
	html string,
	data interface{},
	conn EmailConnection,
) error

* 发送HTML信 * 参数: * 1. from string:发信邮箱地址 * 2. to []string:寄送邮箱地址,可以多个 * 3. subject string:邮件主题 * 4. html string:邮件内容html模板所在的路径,必须能找到 * 5. data interface{}:需要加载到html模板中的数据集合 * 6. conn EmailConnection:邮件连接信息

func SendPlainMail

func SendPlainMail(
	from string,
	to []string,
	subject string,
	text string,
	conn EmailConnection,
) error

* 发送平信(纯文字信) * 参数: * 1. from string:发信邮箱地址 * 2. to []string:寄送邮箱地址,可以多个 * 3. subject string:邮件主题 * 4. text string:邮件内容 * 5. conn EmailConnection:邮件连接信息

Types

type EmailConnection

type EmailConnection struct {
	Server   string `json:"server"`    // smtp服务器地址
	Port     int    `json:"port"`      // smtp服务器端口
	Username string `json:"user-name"` // smtp登录名
	Password string `json:"password"`  // smtp密码,可以是授权码
}

EmailConnection结构体

Jump to

Keyboard shortcuts

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