mail

package
v0.17.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

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

Mail struct holds necessary data to send emails.

func New

func New(senderAddress, smtpHostAddress string) *Mail

New returns a new instance of a Mail notification service.

func (*Mail) AddReceivers

func (m *Mail) AddReceivers(addresses ...string)

AddReceivers takes email addresses and adds them to the internal address list. The Send method will send a given message to all those addresses.

func (*Mail) AuthenticateSMTP

func (m *Mail) AuthenticateSMTP(identity, userName, password, host string)

AuthenticateSMTP authenticates you to send emails via smtp. Example values: "", "test@gmail.com", "password123", "smtp.gmail.com" For more information about smtp authentication, see here:

-> https://pkg.go.dev/net/smtp#PlainAuth

func (Mail) Send

func (m Mail) Send(ctx context.Context, subject, message string) error

Send takes a message subject and a message body and sends them to all previously set chats. Message body supports html as markup language.

Jump to

Keyboard shortcuts

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