Documentation ¶
Index ¶
- Constants
- Variables
- func LoginAuth(username, password string) *loginAuth
- type Config
- type Content
- type Email
- type File
- type Message
- func (m *Message) AddContent(content *Content)
- func (m *Message) AddRecipient(recipient string)
- func (m *Message) AttachFile(file *File)
- func (m *Message) Bytes() ([]byte, error)
- func (m *Message) FileCount() int
- func (m *Message) IsFile() bool
- func (m *Message) Recipients() string
- func (m *Message) Sender() string
- func (m *Message) SenderAddress() string
- func (m *Message) SenderName() string
- func (m *Message) SetSender(name, address string)
- func (m *Message) SetSubject(subject string)
- func (m *Message) String() (string, error)
- func (m *Message) Subject() string
- type MessageInfo
- type ReceiveFunc
- type SMTPServer
- type ServerInfo
- type Stat
Constants ¶
View Source
const ( SenderHeader = "From:" RecipientHeader = "To:" SubjectHeader = "Subject:" )
Variables ¶
View Source
var ( ErrSubjectExist = errors.New("Subject of the message is already exists") ErrNoRecipient = errors.New("No recipient") )
Functions ¶
Types ¶
type Config ¶
type Config struct { Key string `yaml:"key"` Description string `yaml:"description"` SMTP ServerInfo `yaml:"smtp"` POP3 ServerInfo `yaml:"pop3"` Email string `yaml:"email"` Username string `yaml:"username"` Password string `yaml:"password"` }
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
func (*Email) ReadMessage ¶
func (e *Email) ReadMessage(key string, number int64) (*MessageInfo, error)
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage() *Message
func (*Message) AddContent ¶
func (*Message) AddRecipient ¶
func (*Message) AttachFile ¶
func (*Message) Recipients ¶
func (*Message) SenderAddress ¶
func (*Message) SenderName ¶
func (*Message) SetSubject ¶
type MessageInfo ¶
type MessageInfo struct {
// contains filtered or unexported fields
}
func NewMessageInfo ¶
func NewMessageInfo(reader *textproto.Reader) *MessageInfo
func (*MessageInfo) Contents ¶
func (m *MessageInfo) Contents() []*Content
func (*MessageInfo) Date ¶
func (m *MessageInfo) Date() string
func (*MessageInfo) Files ¶
func (m *MessageInfo) Files() []*File
func (*MessageInfo) MessageId ¶
func (m *MessageInfo) MessageId() string
func (*MessageInfo) ParseBody ¶
func (m *MessageInfo) ParseBody() error
func (*MessageInfo) Sender ¶
func (m *MessageInfo) Sender() *mail.Address
func (*MessageInfo) Subject ¶
func (m *MessageInfo) Subject() string
type ReceiveFunc ¶
type SMTPServer ¶
type SMTPServer struct { }
func (*SMTPServer) CRAMMD5Auth ¶
func (s *SMTPServer) CRAMMD5Auth(config *Config) smtp.Auth
type ServerInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.