mailKit

package
v1.3.18 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispose

func Dispose()

Dispose 释放资源

func GetMailboxInfoSlice

func GetMailboxInfoSlice() ([]*imap.MailboxInfo, error)

func InitializeImap

func InitializeImap(config *ImapConfig) error

func InitializeSmtp

func InitializeSmtp(config *SmtpConfig, count int) error

InitializeSmtp

e.g. 初始化传参count为2,同时发10条邮件,并不会丢失邮件,10条邮件都会被正常发出去.

func NewMail

func NewMail(from string, to []string, subject string, text, html []byte, cc, bcc []string) *email.Email

func SendMail

func SendMail(mail *email.Email) error

Types

type ImapConfig

type ImapConfig struct {
	Address   string
	TlsConfig *tls.Config
	UserName  string
	Password  string
}

type SmtpConfig

type SmtpConfig struct {
	// e.g. "smtp.163.com:25"
	Address string
	// e.g. "smtp.163.com"
	Host string

	// 邮箱账号
	Account string
	// 邮箱的授权码
	Password string
	// 发件人的昵称(默认: consts.OwnName)
	NickName string
}

Jump to

Keyboard shortcuts

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