Documentation
¶
Overview ¶
Package em is a wrapper around mailbuilder that provides a different syntax for using the mail builder.
// (C) Philip Schlump, 2014-2015. // (C) Rod Brown, 2014.
Use a JSON file that looks like ¶
-- cut --
{ "Username":"yourname@gmail.com" ,"Password":"yourpassword" ,"EmailServer":"smtp.gmail.com" ,"Port":587 }
-- cut --
Put the file in $HOME/.email/email-config.json
Index ¶
- Constants
- type EM
- func (this *EM) Attach(fn string) *EM
- func (this *EM) Bcc(addr string, name string) *EM
- func (this *EM) Cc(addr string, name string) *EM
- func (this *EM) From(addr string, name string) *EM
- func (this *EM) HtmlBody(s string) *EM
- func (this *EM) SendIt() (err error)
- func (this *EM) SetMaxLineLength(n int)
- func (this *EM) SetPrintErrors(b bool)
- func (this *EM) Subject(s string) *EM
- func (this *EM) TextBody(s string) *EM
- func (this *EM) To(addr string, name string) *EM
- type EmailUser
Constants ¶
const (
Version = "Version: 1.0.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EM ¶
type EM struct { EmailCfgFn string EmailConfig EmailUser SmtpAuth smtp.Auth Message *mailbuilder.Message Alt *mailbuilder.MultiPart Mixed *mailbuilder.MultiPart Err error // contains filtered or unexported fields }
func (*EM) Attach ¶
Attach a file to the email - may be a relative path. The file name that is sent in the email will be the base file name.
func (*EM) SetMaxLineLength ¶
The default is 500 wich is a good length for liens. If you need ti to be shorter then this schould be called afer NewEmFile or NewEm
func (*EM) SetPrintErrors ¶
em will print out error messages by default. If you need to turn this off so that error messages are only returnd then pass 'false'. Should be called after NewEmFile or NewEm
type EmailUser ¶
type EmailUser struct { Username string // Something like you@yourdomain.com Password string // Your paassword like password123 EmailServer string // smtp.gmail.com Port int // 587 for example }
---------------------------------------------------------------------------------------------------------------------