sender

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sender provides email sender

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	EmailParams
	logger.L
	// contains filtered or unexported fields
}

Email implements sender interface for VerifyHandler Uses common subject line and "from" for all messages

func NewEmailClient

func NewEmailClient(emailParams EmailParams, l logger.L) *Email

NewEmailClient creates email client

func (*Email) Send

func (e *Email) Send(to, text string) error

Send email with given text

type EmailParams

type EmailParams struct {
	Host        string // SMTP host
	Port        int    // SMTP port
	From        string // From email field
	Subject     string // Email subject
	ContentType string // Content type

	TLS          bool          // TLS auth
	StartTLS     bool          // StartTLS auth
	Charset      string        // Character set
	LoginAuth    bool          // LOGIN auth method instead of default PLAIN, needed for Office 365 and outlook.com
	SMTPUserName string        // username
	SMTPPassword string        // password
	TimeOut      time.Duration // TCP connection timeout
}

EmailParams with all needed to make new Email client with smtp

Jump to

Keyboard shortcuts

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