email

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(user, pass, host string) smtp.Auth

LoginAuth implements the LOGIN authentication mechanism.

Adapted from smtp.PlainAuth in the standard library.

func SendMail

func SendMail(ctx context.Context, addr string, a NegotiateAuth, from string, to []string, msg []byte, cfg *tls.Config) error

SendMail will send a message using the provided server and optional auth. It will attempt to use STARTTLS if available from the server.

func SendMailTLS

func SendMailTLS(ctx context.Context, addr string, a NegotiateAuth, from string, to []string, msg []byte, cfg *tls.Config) error

SendMailTLS will send a message using the provided server over a TLS connection and optional auth.

Types

type NegotiateAuth

type NegotiateAuth func(auths string) smtp.Auth

NegotiateAuth should return the appropriate smtp.Auth for the given server auth string.

type Sender

type Sender struct{}

func NewSender

func NewSender(ctx context.Context) *Sender

func (*Sender) Send

Send will send an for the provided message type.

Jump to

Keyboard shortcuts

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