smtp

package
v1.2.19 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendContent(content Content) error
	// contains filtered or unexported methods
}

func NewTLSClient

func NewTLSClient(cfg Config) (client Client, err error)

type Config

type Config struct {
	Secret    string `yaml:"secret,omitempty" json:"secret,omitempty" xml:"secret,omitempty"`
	Server    string `yaml:"server,omitempty" json:"server,omitempty" xml:"server,omitempty"`
	Port      int    `yaml:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	Sender    string `yaml:"sender,omitempty" json:"sender,omitempty" xml:"sender,omitempty"`
	Signature string `yaml:"signature,omitempty" json:"signature,omitempty" xml:"signature,omitempty"`
	EnableTLS bool   `yaml:"enable_tls,omitempty" json:"enable_tls,omitempty" xml:"enable_tls,omitempty"`
}

type Content

type Content interface {
	ExportToMailText() []byte
	// contains filtered or unexported methods
}

func NewRenderableHtmlContent

func NewRenderableHtmlContent(receiver string, subject string, template template.Template) Content

func NewRenderableTextContent

func NewRenderableTextContent(receiver string, subject string, template template.Template) Content

func NewStaticHtmlContent

func NewStaticHtmlContent(receiver string, subject string, content string) Content

func NewStaticTextContent

func NewStaticTextContent(receiver string, subject string, content string) Content

type DialSmtpServerError

type DialSmtpServerError struct {
	Err error
}

func NewDialSmtpServerError

func NewDialSmtpServerError(err error) *DialSmtpServerError

func (*DialSmtpServerError) Error

func (d *DialSmtpServerError) Error() string

type InitMailContentError

type InitMailContentError struct {
	Content []byte
	Err     error
}

func NewInitMailContentError

func NewInitMailContentError(content []byte, err error) *InitMailContentError

func (*InitMailContentError) Error

func (i *InitMailContentError) Error() string

type RenderableContent

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

func (*RenderableContent) ExportToMailText

func (c *RenderableContent) ExportToMailText() []byte

type StaticContent

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

func (*StaticContent) ExportToMailText

func (c *StaticContent) ExportToMailText() []byte

Jump to

Keyboard shortcuts

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