mail

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoSendMail

func DoSendMail(server_address string, auth_user string, auth_password string, mail_title string, mail_content string, options ...OptionFunc) (err error)

单次调用,发送邮件

Types

type MailSender

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

func New

func New(server_address string, auth_user string, auth_password string, options ...OptionFunc) *MailSender

func (*MailSender) SendMail

func (mail_sender *MailSender) SendMail(mail_title string, mail_content string) (err error)

type OptionFunc

type OptionFunc func(*MailSender)

func WithContentType

func WithContentType(s string) OptionFunc

发件人名称为空时,使用 smtp_user 中 @ 之前的部分作为发件人名称

func WithOptions

func WithOptions(options MailSender) OptionFunc

func WithReceiver

func WithReceiver(receiver []string) OptionFunc

收件人为空时,使用 smtp_user 作为收件人

func WithSender

func WithSender(s string) OptionFunc

发件人为空时,使用 smtp_user 作为发件人

func WithSenderUsername

func WithSenderUsername(s string) OptionFunc

发件人名称为空时,使用 smtp_user 中 @ 之前的部分作为发件人名称

func WithServerPort

func WithServerPort(i uint) OptionFunc

发件人为空时,使用 smtp_user 作为发件人

Jump to

Keyboard shortcuts

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