mail

package
v0.0.0-...-f08e3d1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SMTPAuthNone    = "none"
	SMTPAuthPlain   = "plain"
	SMTPAuthCRAMMD5 = "cram-md5"
)

Variables

Functions

This section is empty.

Types

type AuthMechanism

type AuthMechanism int

type Client

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

func NewClient

func NewClient(config Config) *Client

func (*Client) Auth

func (c *Client) Auth(logger lager.Logger) error

func (*Client) AuthMechanism

func (c *Client) AuthMechanism(logger lager.Logger) smtp.Auth

func (*Client) Connect

func (c *Client) Connect(logger lager.Logger) error

func (*Client) Data

func (c *Client) Data(msg Message) error

func (*Client) Error

func (c *Client) Error(logger lager.Logger, err error) error

func (*Client) Extension

func (c *Client) Extension(name string) (bool, string)

func (*Client) Hello

func (c *Client) Hello() error

func (*Client) PrintLog

func (c *Client) PrintLog(logger lager.Logger, action string, data ...lager.Data)

func (*Client) Quit

func (c *Client) Quit() error

func (*Client) Send

func (c *Client) Send(msg Message, logger lager.Logger) error

func (*Client) StartTLS

func (c *Client) StartTLS() error

type Config

type Config struct {
	Host              string
	Port              string
	User              string
	Pass              string
	Secret            string
	SMTPAuthMechanism string
	TestMode          bool
	SkipVerifySSL     bool
	DisableTLS        bool
	ConnectTimeout    time.Duration
	LoggingEnabled    bool
}

type Message

type Message struct {
	Date                    string
	MimeVersion             string
	ContentType             string
	ContentTransferEncoding string
	From                    string
	ReplyTo                 string
	To                      string
	Subject                 string
	Body                    []Part
	Headers                 []string
	CompiledBody            string
}

func (Message) Boundary

func (msg Message) Boundary() string

func (*Message) CompileBody

func (msg *Message) CompileBody() error

func (*Message) Data

func (msg *Message) Data() string

type Part

type Part struct {
	ContentType string
	Content     string
}

Jump to

Keyboard shortcuts

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