pmailer

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

邮件发送类

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmailHTMLContent

func GetEmailHTMLContent(mailTpl string, mailData interface{}) (string, error)

GetEmailHTMLContent 获取邮件模板 mailTpl: string 邮件模板路径 mailData: interface{} 邮件默认需要传递的数据

func GetTplContentByFile

func GetTplContentByFile(tplPath string, mailData interface{}) (string, error)

GetTplContentByFile 获取指定邮件模板内容 tplPath: string 邮件模板文件地址 mailData: interface{} 解析后的邮件内容

func Send

func Send(smtp EmailSererConfig, params EmailConfig) (bool, error)

Send 发送邮件 smtp: 发件服务器配置 params: 收件人配置

Types

type AttachFormat

type AttachFormat struct {
	Filename string
	Settings []gomail.FileSetting
}

附件传参结构体

type EmailConfig

type EmailConfig struct {
	To      []string       //收件人地址
	Cc      []string       //抄送地址
	Subject string         //邮件主题
	Body    string         //邮件内容,html格式
	Attach  []AttachFormat //附件
}

收件传参结构体

type EmailSererConfig

type EmailSererConfig struct {
	ServerAddress string //邮件服务地址
	Port          int    //邮件端口
	Username      string //发件人地址
	Password      string //密码
}

发件服务传参结构体

Jump to

Keyboard shortcuts

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