easyMail

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

README

easyMail

Super easy mail server written in go

Documentation

Index

Constants

View Source
const (
	GMAIL   = "gmail"
	YAHOO   = "yahoo"
	OUTLOOK = "outlook"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	From    string
	To      []string
	Cc      []string
	Bcc     []string
	Subject string
	Body    string

	Attachments map[string][]byte
	Headers     map[string]string
	// contains filtered or unexported fields
}

func NewMail

func NewMail(
	from string,
	to []string,
	subject string,
	body string,
	isHtml bool,
) *Mail

func (*Mail) AddAttachment added in v0.1.2

func (m *Mail) AddAttachment(path string) error

func (*Mail) AddAttachmentAll added in v0.1.2

func (m *Mail) AddAttachmentAll(paths []string) error

func (*Mail) AddBcc added in v0.1.2

func (m *Mail) AddBcc(bcc string)

func (*Mail) AddBccAll added in v0.1.2

func (m *Mail) AddBccAll(bcc []string)

func (*Mail) AddCc added in v0.1.2

func (m *Mail) AddCc(cc string)

func (*Mail) AddCcAll added in v0.1.2

func (m *Mail) AddCcAll(cc []string)

func (*Mail) AddHeader added in v0.1.1

func (m *Mail) AddHeader(key string, value string)

func (*Mail) AddHtmlFile added in v0.1.2

func (m *Mail) AddHtmlFile(path string) error

func (*Mail) AddTo added in v0.1.2

func (m *Mail) AddTo(to string)

func (*Mail) AddToAll added in v0.1.2

func (m *Mail) AddToAll(to []string)

func (*Mail) AttachTextFile added in v0.1.2

func (m *Mail) AttachTextFile(src string) error

func (*Mail) Raw added in v0.1.2

func (m *Mail) Raw() (string, error)

func (*Mail) ToBytes added in v0.1.2

func (m *Mail) ToBytes() ([]byte, error)

type MailSender

type MailSender struct {
	Email    string
	Password string
	Provider string
}

type MailServer

type MailServer struct {
	Sender MailSender
	Auth   smtp.Auth
}

func NewMailServer

func NewMailServer(email, password, provider string) *MailServer

func NewMailServerFromSender added in v0.1.1

func NewMailServerFromSender(sender MailSender) *MailServer

func (*MailServer) SendMail

func (s *MailServer) SendMail(mail *Mail) error

Jump to

Keyboard shortcuts

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