smtp

package
v0.0.0-...-fe1b72b Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 定义 SMTP 客户端的数据结构

func New

func New(smtpServer string, smtpPort int) *Client

New 新建一个 SMTP 客户端

func (*Client) SendHTML

func (own *Client) SendHTML(username, password string, msg *Message) error

SendText 发送HTML样式的邮件

func (*Client) SendText

func (own *Client) SendText(username, password string, msg *Message) error

SendText 发送文本样式的邮件

type Message

type Message struct {
	Subject string   // 主题
	To      []string // 主送
	Cc      []string // 抄送
	Bcc     []string // 密送
	Body    []byte   // 内容
	// contains filtered or unexported fields
}

func (*Message) GeneateHTML

func (own *Message) GeneateHTML(form string) ([]byte, error)

func (*Message) GeneateText

func (own *Message) GeneateText(form string) ([]byte, error)

func (*Message) Validate

func (own *Message) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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