mail

package
v0.0.0-...-8ed7984 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailClient

type EmailClient struct {
	Host     string
	Port     int
	Username string
	Password string
	Message  *EmailMessage
}

EmailClient 发送客户端

func NewEmailClient

func NewEmailClient(host, username, password string, port int, message *EmailMessage) *EmailClient

NewEmailClient 返回一个邮件客户端 host smtp地址 username 用户名 password 密码 port 端口

func (*EmailClient) SendMessage

func (c *EmailClient) SendMessage() (bool, error)

SendMessage 发送邮件

type EmailMessage

type EmailMessage struct {
	From        string
	Nickname    string
	To          []string
	Cc          []string
	Subject     string
	ContentType string
	Content     string
	Attach      string
}

EmailMessage 内容

func NewEmailMessage

func NewEmailMessage(from, nickname, subject, contentType, content, attach string, to, cc []string) *EmailMessage

NewEmailMessage 返回消息对象 from: 发件人 subject: 标题 contentType: 内容的类型 text/plain text/html attach: 附件 to: 收件人 cc: 抄送人

Jump to

Keyboard shortcuts

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