mailsender

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 8 Imported by: 0

README

mailsender

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password, domain string) smtp.Auth

Types

type Builder

type Builder interface {
	Email() EmailBuilder
	SMTPClient() SMTPClientBuilder
}

func New

func New() Builder

type Email

type Email interface {
	WithTo(recipients ...string) Email
	WithCarbonCopy(copyes ...string) Email
	WithBlindCarbonCopy(blindCopyes ...string) Email
}

type EmailBuilder

type EmailBuilder interface {
	Subject(subject string) EmailBuilder
	From(sender string) EmailBuilder
	To(recipients ...string) EmailBuilder
	CarbonCopy(copyes ...string) EmailBuilder
	BlindCarbonCopy(blindCopyes ...string) EmailBuilder
	Text(text string) EmailBuilder
	HTML(html string) EmailBuilder
	Attach(filename, contectType string, data []byte) EmailBuilder
	AttachFromReader(filename, contectType string, r io.Reader) EmailBuilder
	AttachFromFile(filename string) EmailBuilder
	Build() *email
}

func NewEmail

func NewEmail() EmailBuilder

type SMTPClient

type SMTPClient interface {
	Send(*email) error
}

type SMTPClientBuilder

type SMTPClientBuilder interface {
	Host(host string) SMTPClientBuilder
	Login(login string) SMTPClientBuilder
	Password(password string) SMTPClientBuilder
	TLS(isTLS bool) SMTPClientBuilder
	SSL(isSSL bool) SMTPClientBuilder
	Build() (*smtpClient, error)
}

func NewSMTPClient

func NewSMTPClient() SMTPClientBuilder

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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