Documentation ¶
Index ¶
- Constants
- func Exists(file string) bool
- func GetEnv() string
- func GetMimeType(fileName string) (mimeType string)
- func RandomBoundary() string
- func ReadFile(file string, obj interface{}) ([]byte, error)
- func ReadFileLines(file string) ([]string, error)
- func SendMail(addr string, a Auth, from string, to []string, msg []byte) ([]string, error)
- func WriteFile(file string, obj interface{}) error
- type AppConfig
- type Attachment
- type Auth
- type Charset
- type Client
- func (c *Client) Auth(a Auth) error
- func (c *Client) Close() error
- func (c *Client) Data() (io.WriteCloser, error)
- func (c *Client) Extension(ext string) (bool, string)
- func (c *Client) Hello(localName string) error
- func (c *Client) Mail(from string) error
- func (c *Client) Quit() error
- func (c *Client) Rcpt(to string) error
- func (c *Client) Reset() error
- func (c *Client) StartTLS(config *tls.Config) error
- func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
- func (c *Client) Verify(addr string) error
- type ContentType
- type Encoding
- type Mailer
- type MailerConfig
- type MailerOption
- type Message
- type MimeVersion
- type SendMessageService
- func (e *SendMessageService) Attachment(content []byte, inline bool, fileName string) *SendMessageService
- func (e *SendMessageService) Bcc(bcc ...string) *SendMessageService
- func (e *SendMessageService) Body(contentType ContentType, body string) *SendMessageService
- func (e *SendMessageService) Cc(cc ...string) *SendMessageService
- func (e *SendMessageService) Date(date time.Time) *SendMessageService
- func (e *SendMessageService) Execute() ([]string, error)
- func (e *SendMessageService) From(name, address string) *SendMessageService
- func (e *SendMessageService) Header(key string, value string) *SendMessageService
- func (e *SendMessageService) Subject(subject string) *SendMessageService
- func (e *SendMessageService) Template(path, name string, reload bool) *SendMessageService
- func (e *SendMessageService) To(to ...string) *SendMessageService
- type ServerInfo
Constants ¶
View Source
const ( EncodingBase64 Encoding = "base64" ContentTypeJSON ContentType = "application/json" ContentTypeJavaScript ContentType = "application/javascript" ContentTypeXML ContentType = "application/xml" ContentTypeTextXML ContentType = "text/xml" ContentTypeForm ContentType = "application/x-www-form-urlencoded" ContentTypeProtobuf ContentType = "application/protobuf" ContentTypeMsgpack ContentType = "application/msgpack" ContentTypeTextHTML ContentType = "text/html" ContentTypeTextPlain ContentType = "text/plain" ContentTypeMultipartForm ContentType = "multipart/form-data" ContentTypeOctetStream ContentType = "application/octet-stream" MimeVersion1 MimeVersion = "1.0" CharsetUTF8 Charset = "UTF-8" )
Variables ¶
This section is empty.
Functions ¶
func GetMimeType ¶
func RandomBoundary ¶
func RandomBoundary() string
func ReadFileLines ¶
Types ¶
type Attachment ¶
type Auth ¶
type Auth interface { Start(server *ServerInfo) (proto string, toServer []byte, err error) Next(fromServer []byte, more bool) (toServer []byte, err error) }
func CRAMMD5Auth ¶
type Client ¶
func (*Client) TLSConnectionState ¶
func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
type ContentType ¶
type ContentType string
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func (*Mailer) Reconfigure ¶
func (mailer *Mailer) Reconfigure(options ...MailerOption)
Reconfigure ...
func (*Mailer) SendMessage ¶
func (e *Mailer) SendMessage() *SendMessageService
type MailerConfig ¶
type MailerConfig struct { Log struct { Level string `json:"level"` } `json:"log"` Host string `json:"host"` Port string `json:"port"` Identity string `json:"identity"` Username string `json:"username"` Password string `json:"password"` }
MailerConfig ...
type MailerOption ¶
type MailerOption func(client *Mailer)
MailerOption ...
func WithConfiguration ¶
func WithConfiguration(config *MailerConfig) MailerOption
WithConfiguration ...
type Message ¶
type Message struct { MimeVersion MimeVersion Headers map[string]string FromName string FromAddr string ToAddrs []string CcAddrs []string BccAddrs []string Date string ReplyToAddr string Subject string BoundaryMixed string BoundaryAlternative string ContentType ContentType Charset Charset Body string Attachments []*Attachment // contains filtered or unexported fields }
type MimeVersion ¶
type MimeVersion string
type SendMessageService ¶
type SendMessageService struct {
// contains filtered or unexported fields
}
func NewSendMessageService ¶
func NewSendMessageService(e *Mailer) *SendMessageService
func (*SendMessageService) Attachment ¶
func (e *SendMessageService) Attachment(content []byte, inline bool, fileName string) *SendMessageService
func (*SendMessageService) Bcc ¶
func (e *SendMessageService) Bcc(bcc ...string) *SendMessageService
func (*SendMessageService) Body ¶
func (e *SendMessageService) Body(contentType ContentType, body string) *SendMessageService
func (*SendMessageService) Cc ¶
func (e *SendMessageService) Cc(cc ...string) *SendMessageService
func (*SendMessageService) Date ¶
func (e *SendMessageService) Date(date time.Time) *SendMessageService
func (*SendMessageService) Execute ¶
func (e *SendMessageService) Execute() ([]string, error)
func (*SendMessageService) From ¶
func (e *SendMessageService) From(name, address string) *SendMessageService
func (*SendMessageService) Header ¶
func (e *SendMessageService) Header(key string, value string) *SendMessageService
func (*SendMessageService) Subject ¶
func (e *SendMessageService) Subject(subject string) *SendMessageService
func (*SendMessageService) Template ¶
func (e *SendMessageService) Template(path, name string, reload bool) *SendMessageService
func (*SendMessageService) To ¶
func (e *SendMessageService) To(to ...string) *SendMessageService
type ServerInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.