mail

package
v0.0.0-...-f8d955e Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: MIT Imports: 12 Imported by: 0

README

MOVED

This package has moved to github.com/gabstv/libmail

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Verbose = false
)

Functions

This section is empty.

Types

type Address

type Address struct {
	Email string
	Name  string
}

func NewAddress

func NewAddress(name, email string) Address

type AttachmentInfo

type AttachmentInfo struct {
	File     io.ReadCloser
	Name     string
	MimeType string
	Path     string // optional path in disk
}

type AttachmentList

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

func NewAttachmentList

func NewAttachmentList() *AttachmentList

func (*AttachmentList) Add

func (l *AttachmentList) Add(item *AttachmentInfo)

func (*AttachmentList) Count

func (l *AttachmentList) Count() int

func (*AttachmentList) First

func (l *AttachmentList) First() *AttachmentListItem

func (*AttachmentList) GetFilenames

func (l *AttachmentList) GetFilenames() []string

func (*AttachmentList) Last

func (*AttachmentList) PurgeFiles

func (l *AttachmentList) PurgeFiles()

type AttachmentListItem

type AttachmentListItem struct {
	Value *AttachmentInfo
	// contains filtered or unexported fields
}

func (*AttachmentListItem) Next

type Message

type Message struct {
	From          Address
	To            []Address
	Subject       string
	HTMLBody      string
	PlaintextBody string
	Files         *AttachmentList
	RawHeaders    map[string]string
}

func NewMessage

func NewMessage() *Message

func (*Message) AddRecipient

func (m *Message) AddRecipient(to Address)

type SMTP

type SMTP struct {
	Auth    smtp.Auth
	Address string
	TLS     *tls.Config
}

func NewSMTP

func NewSMTP(auth smtp.Auth, address string) *SMTP

func (*SMTP) SetTLS

func (s *SMTP) SetTLS(tlsc *tls.Config)

func (*SMTP) SubmitHTML

func (s *SMTP) SubmitHTML(fromEmail, fromName, toEmail, toName, subject, htmlBody string, files *AttachmentList) (int, error)

func (*SMTP) SubmitMessage

func (s *SMTP) SubmitMessage(msg *Message) error

func (*SMTP) SubmitMixed

func (s *SMTP) SubmitMixed(fromEmail, fromName, toEmail, toName, subject, plainBody string, htmlBody string, files *AttachmentList) (int, error)

func (*SMTP) SubmitPlaintext

func (s *SMTP) SubmitPlaintext(fromEmail, fromName, toEmail, toName, subject, plainBody string, files *AttachmentList) (int, error)

Jump to

Keyboard shortcuts

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