mail

package
v0.0.0-...-dbdcb34 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TIMEOUT = 10 * time.Second

Variables

This section is empty.

Functions

func ExtractTopMostPortion

func ExtractTopMostPortion(fullBody string) string

Types

type Email

type Email struct {
	MessageID string
	InReplyTo string
	DebugKey  string

	From    EmailAddress
	To      EmailAddresses
	CC      EmailAddresses
	Subject string
	Date    string

	Text string
	HTML string
}

func E

func E() Email

func ParseIncomingEmail

func ParseIncomingEmail(db S3DBInt, data []byte, debug io.Writer) (Email, error)

func (Email) AndCC

func (e Email) AndCC(cc ...EmailAddress) Email

func (Email) Dup

func (e Email) Dup() Email

func (Email) Forward

func (e Email) Forward(from EmailAddress, to EmailAddress, body any) Email

func (Email) IncludesRecipient

func (c Email) IncludesRecipient(recipient EmailAddress) bool

func (Email) IsZero

func (e Email) IsZero() bool

func (Email) Recipients

func (e Email) Recipients() EmailAddresses

func (Email) Reply

func (e Email) Reply(from EmailAddress, body any) Email

func (Email) ReplyAll

func (e Email) ReplyAll(from EmailAddress, body any) Email

func (Email) ReplyAllWithoutQuote

func (e Email) ReplyAllWithoutQuote(from EmailAddress, body any) Email

func (Email) ReplyWithoutQuote

func (e Email) ReplyWithoutQuote(from EmailAddress, body any) Email

func (Email) String

func (e Email) String() string

func (Email) WithBody

func (e Email) WithBody(body any) Email

func (Email) WithFrom

func (e Email) WithFrom(from EmailAddress) Email

func (Email) WithSubject

func (e Email) WithSubject(subject string) Email

func (Email) WithTo

func (e Email) WithTo(to ...EmailAddress) Email

type EmailAddress

type EmailAddress string

func (EmailAddress) Address

func (e EmailAddress) Address() string

func (EmailAddress) Equals

func (e EmailAddress) Equals(other EmailAddress) bool

func (EmailAddress) HasExplicitName

func (e EmailAddress) HasExplicitName() bool

func (EmailAddress) Name

func (e EmailAddress) Name() string

func (EmailAddress) String

func (e EmailAddress) String() string

type EmailAddresses

type EmailAddresses []EmailAddress

func (EmailAddresses) String

func (e EmailAddresses) String() string

func (EmailAddresses) Strings

func (e EmailAddresses) Strings() []string

type FakeOutbox

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

func NewFakeOutbox

func NewFakeOutbox() *FakeOutbox

func (*FakeOutbox) Clear

func (o *FakeOutbox) Clear()

func (*FakeOutbox) Emails

func (o *FakeOutbox) Emails() []Email

func (*FakeOutbox) EnableLogging

func (o *FakeOutbox) EnableLogging(w io.Writer)

func (*FakeOutbox) LastEmail

func (o *FakeOutbox) LastEmail() Email

func (*FakeOutbox) SendEmail

func (o *FakeOutbox) SendEmail(email Email) error

func (*FakeOutbox) SetError

func (o *FakeOutbox) SetError(err error)

type Markdown

type Markdown string

type Outbox

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

func NewOutbox

func NewOutbox(forwardEmailKey, gmailUser, gmailPassword string) Outbox

func (Outbox) SendEmail

func (o Outbox) SendEmail(email Email) error

type OutboxInt

type OutboxInt interface {
	SendEmail(Email) error
}

type S3DBInt

type S3DBInt interface {
	PutObject(key string, data []byte) error
}

Jump to

Keyboard shortcuts

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