email

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(conf *EmailConfig) error

func SendEmail

func SendEmail(param EmailParam) error

SendEmail /*

邮件发送示例:

email.SendEmail(email.EmailParam{
		To:      "hwu@hongdian.com",
		Data:    "8888",
		MsgCode: msgtype.RegCode.MsgCode,
	})

func SendEmailByData

func SendEmailByData(subject, content string, to []string) error

SendEmailByData /*

邮件发送示例: email.SendEmailByData(

	subject:      "邮件主题",
	content:    "邮件内容",
	to:      ["hwu@hongdian.com","hwu2@hongdian.com"],
)

func SendEmailByType

func SendEmailByType(param EmailParam, msgType msgtype.MsgType) error

SendEmailByType /*

邮件发送示例:

email.SendEmailByType(email.EmailParam{
		To:      "hwu@hongdian.com",
		Data:    "8888",
	},msgtype.MsgType{Msg:'',Name:''})

Types

type EmailConfig

type EmailConfig struct {
	Host     string
	Port     int
	Username string
	Password string
}

type EmailParam

type EmailParam struct {
	To      []string
	Data    string
	Test    bool
	MsgCode string //see msttype.sms_type
}

Jump to

Keyboard shortcuts

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