mail

package
v0.0.0-...-0e99106 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthMessage

func NewAuthMessage(sendTo string, code string) []byte

Generate a new authentication message given a target email and a gate code.

Input:

  • sendTo string: Email to send the code to
  • code string: Authentication code

Output:

  • []byte: Properly formatted message for sending through smtp.

func SendMessage

func SendMessage(sendFrom Host, sendTo string, msg []byte) error

Send a message from a Host to an email address.

Input:

  • sendFrom Host: SMTP host information
  • sendTo string: Target email address
  • msg []byte: Message to send. Use NewAuthMessage() to generate this.

Output:

  • error: Any error that occurs when sending mail. This only includes failure to *access* the SMTP server, or invalid credentials; if all configuration is correct but the email fails to go through or sendTo is not a valid address, no error will be returned.

Types

type Host

type Host struct {
	Username string
	Password string
	Host     string
	Port     int
	Sender   string
}

struct Host holds host data for sending SMTP through SES.

Jump to

Keyboard shortcuts

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