smtp

package
v1.72.25 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup(domain string) string

Lookup main smtp server by service domain

Types

type Client added in v1.71.0

type Client struct {
	Client chan *email.Email
	OnSent func(*email.Email, []byte, error) // for messages in send Client
	// contains filtered or unexported fields
}

Client smtp with queue

func NewClient added in v1.71.0

func NewClient(conf ClientConfig, log logger.Logger) (*Client, error)

NewClient smtp with queue

func (*Client) Close added in v1.71.0

func (c *Client) Close(waitForSendRemaining bool)

Close send Client

func (*Client) Prepare added in v1.71.0

func (c *Client) Prepare(msg *email.Email) error

Prepare email

func (*Client) Send added in v1.71.0

func (c *Client) Send(msg *email.Email) error

Send email

func (*Client) SendNow added in v1.71.0

func (c *Client) SendNow(msg *email.Email) ([]byte, error)

SendNow email, without enClient

func (*Client) Wait added in v1.71.0

func (c *Client) Wait()

Wait for send remaiming

type ClientConfig added in v1.71.0

type ClientConfig struct {
	Server string `desc:"smtp server, auto lookup by default"`
	Port   uint16 `desc:"possible: 25/2525 (unsafe), 587 (TLS), 465 (SSL)"` // 587 by default

	Username string `desc:"required, usually email" encoding:"manual"`
	Password string `desc:"optional, raw password"  encoding:"manual"`
	FromMail string `desc:"optional, Username by default"`
	FromName string `desc:"optional, Username prefix by default"`

	DefaultTo  []string `desc:"recipients"`
	DefaultCc  []string `desc:"recipients, carbon copy"`
	DefaultBcc []string `desc:"recipients, blind carbon copy"`

	SendQueueSize int
	// contains filtered or unexported fields
}

ClientConfig for smtp sender

func (*ClientConfig) ValidAndRepair added in v1.71.0

func (c *ClientConfig) ValidAndRepair() error

ValidAndRepair smtp config

Jump to

Keyboard shortcuts

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