Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeBase64WithNewLine(content []byte) (b []byte, size int64)
- func EncodeQuotedPrintable(value []byte) []byte
- func EncodeQuotedPrintableString(value string) string
- func MergeMessageWithSignature(msg, mimetype, sign string) []byte
- type Addresses
- type Attachment
- type Mail
- func (m *Mail) AddBcc(email, name string) error
- func (m *Mail) AddCc(email, name string) error
- func (m *Mail) AddHeader(key, value string)
- func (m *Mail) AddTo(email, name string) error
- func (m *Mail) AppendHTMLMessage(msg string)
- func (m *Mail) AppendMessage(mimetype, msg string)
- func (m *Mail) AppendTextMessage(msg string)
- func (m *Mail) Attach(name string, b []byte) error
- func (m *Mail) AttachFD(fd *os.File) error
- func (m *Mail) AttachFile(fpath string) (err error)
- func (m *Mail) AttachmentLimit() int64
- func (m *Mail) Attachments() []Attachment
- func (m *Mail) Bcc() Addresses
- func (m *Mail) BounceTo() mail.Address
- func (m *Mail) Bytes() []byte
- func (m *Mail) Cc() Addresses
- func (m *Mail) Clone() *Mail
- func (m *Mail) DelHeader(key string)
- func (m *Mail) From() mail.Address
- func (m *Mail) GetHeader(key string) string
- func (m *Mail) Message() map[string]string
- func (m *Mail) ReplyTo() mail.Address
- func (m *Mail) SetAttachmentLimit(l int64)
- func (m *Mail) SetBcc(email, name string) error
- func (m *Mail) SetBounceTo(email string) error
- func (m *Mail) SetCc(email, name string) error
- func (m *Mail) SetFrom(email, name string) error
- func (m *Mail) SetHTMLMessage(msg string)
- func (m *Mail) SetHeader(key, value string)
- func (m *Mail) SetMessage(mimetype, msg string)
- func (m *Mail) SetReplyTo(email, name string) error
- func (m *Mail) SetSubject(subj string)
- func (m *Mail) SetTextMessage(msg string)
- func (m *Mail) SetTo(email string, name string) error
- func (m *Mail) String() string
- func (m *Mail) Subject() string
- func (m *Mail) To() Addresses
- type Mailer
- type MessageEncoder
- type SMTPMailer
- func (ml *SMTPMailer) Auth() smtp.Auth
- func (ml *SMTPMailer) DefaultMail() *Mail
- func (ml *SMTPMailer) Host() string
- func (ml *SMTPMailer) Port() int
- func (ml *SMTPMailer) Send(m *Mail) error
- func (ml *SMTPMailer) SendAsync(m *Mail) <-chan error
- func (ml *SMTPMailer) Server() chan<- *Mail
- func (ml *SMTPMailer) SetAuth(auth smtp.Auth)
- func (ml *SMTPMailer) SetHost(host string)
- func (ml *SMTPMailer) SetPort(port int)
- func (ml *SMTPMailer) SetSignature(sign string)
- func (ml *SMTPMailer) Signature() string
Constants ¶
View Source
const DefaultAttachmentLimit = 25 * 1024 * 1024
View Source
const MaxInt = int64(^uint64(0) >> 1)
Variables ¶
View Source
var ErrAttachmentExceedLimit = errors.New("attachment is bigger than limit")
View Source
var ErrEmailInvalid = errors.New("invalid email address")
View Source
var ErrFileInvalid = errors.New("invalid file")
View Source
var ErrFileIsDir = errors.New("cannot attach directory")
Functions ¶
func EncodeBase64WithNewLine ¶
func EncodeQuotedPrintable ¶
Types ¶
type Attachment ¶
type Mail ¶
type Mail struct {
// contains filtered or unexported fields
}
TODO: add inline attachment (mainly for inline images) support
func (*Mail) AppendHTMLMessage ¶
func (*Mail) AppendMessage ¶
func (*Mail) AppendTextMessage ¶
func (*Mail) AttachFile ¶
func (*Mail) AttachmentLimit ¶
func (*Mail) Attachments ¶
func (m *Mail) Attachments() []Attachment
func (*Mail) SetAttachmentLimit ¶
func (*Mail) SetBounceTo ¶
func (*Mail) SetHTMLMessage ¶
func (*Mail) SetMessage ¶
func (*Mail) SetReplyTo ¶
func (*Mail) SetSubject ¶
func (*Mail) SetTextMessage ¶
type MessageEncoder ¶
type MessageEncoder struct { *quotedprintable.Writer // contains filtered or unexported fields }
func NewMessageEncoder ¶
func NewMessageEncoder() *MessageEncoder
func (*MessageEncoder) Bytes ¶
func (me *MessageEncoder) Bytes() []byte
func (*MessageEncoder) String ¶
func (me *MessageEncoder) String() string
type SMTPMailer ¶
type SMTPMailer struct { *Mail // contains the default settings // contains filtered or unexported fields }
func NewSMTPMailer ¶
func NewSMTPMailer(host string, port int, auth smtp.Auth) *SMTPMailer
func (*SMTPMailer) Auth ¶
func (ml *SMTPMailer) Auth() smtp.Auth
func (*SMTPMailer) DefaultMail ¶
func (ml *SMTPMailer) DefaultMail() *Mail
func (*SMTPMailer) Host ¶
func (ml *SMTPMailer) Host() string
func (*SMTPMailer) Port ¶
func (ml *SMTPMailer) Port() int
func (*SMTPMailer) Send ¶
func (ml *SMTPMailer) Send(m *Mail) error
func (*SMTPMailer) SendAsync ¶
func (ml *SMTPMailer) SendAsync(m *Mail) <-chan error
func (*SMTPMailer) Server ¶
func (ml *SMTPMailer) Server() chan<- *Mail
func (*SMTPMailer) SetAuth ¶
func (ml *SMTPMailer) SetAuth(auth smtp.Auth)
func (*SMTPMailer) SetHost ¶
func (ml *SMTPMailer) SetHost(host string)
func (*SMTPMailer) SetPort ¶
func (ml *SMTPMailer) SetPort(port int)
func (*SMTPMailer) SetSignature ¶
func (ml *SMTPMailer) SetSignature(sign string)
func (*SMTPMailer) Signature ¶
func (ml *SMTPMailer) Signature() string
Click to show internal directories.
Click to hide internal directories.