mail

package
v10.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(ctx context.Context, to []string, cc []string, bcc []string, subject string, body string, file ...string) error

Use smtp client send email with to/cc/bcc

func SendTo

func SendTo(ctx context.Context, to []string, subject string, body string, file ...string) error

Use smtp client send email, use to specify recipients

func SetSender

func SetSender(sender *SmtpSender)

Set a global SMTP sender

Types

type SmtpSender

type SmtpSender struct {
	SmtpHost string
	Port     int
	FromName string
	FromMail string
	UserName string
	AuthCode string
}

A smtp email client

func (*SmtpSender) Send

func (s *SmtpSender) Send(ctx context.Context, to []string, cc []string, bcc []string, subject string, body string, file ...string) error

func (*SmtpSender) SendTo

func (s *SmtpSender) SendTo(ctx context.Context, to []string, subject string, body string, file ...string) error

Jump to

Keyboard shortcuts

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