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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
simple command

Jump to

Keyboard shortcuts

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