Documentation ¶
Overview ¶
Package tinymail provides a simple and easy to use interface to send smtp emails.
Index ¶
Constants ¶
View Source
const DEFAULT_SMTP_PORT int = 587
Variables ¶
This section is empty.
Functions ¶
func FromString ¶ added in v0.7.0
func FromString(str string) *message
FromString creates a new message with content from given string.
func FromTemplateFile ¶
FromTemplateFile creates a new message with content from parsed template file.
Returns an error if the template file could not be parsed.
func FromTemplateString ¶
FromTemplateString creates a new message with content from parsed template string.
Returns an error if the template string could not be parsed.
func New ¶
func New(opts MailerOpts) (*mailer, error)
New returns a new Mailer instance
Returns an error, if opts could not be validated
Types ¶
type MailerOpts ¶ added in v0.7.0
type Message ¶
type Message interface { SetFrom(from string) From() string SetTo(to ...string) To() []string SetCC(cc ...string) CC() []string SetBCC(bcc ...string) BCC() []string SetSubject(s string) Subject() string Attach(files ...string) error Attachments() map[string][]byte Body() string SetUrgentPriority() SetNonUrgentPriority() SetNormalPriority() Priority() string }
Click to show internal directories.
Click to hide internal directories.