Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler func(mail *MailEnvelope)
Handler is a callback type for treating received mail
type MailEnvelope ¶
MailEnvelope describes the minimum information sent and received by a mail server
type MailSender ¶
type MailSender interface {
SendMail(envelope *MailEnvelope) error
}
MailSender allows simple mail sending.
type MailServer ¶
MailServer contains the information necessary to run a server which receives and handles mail.
func NewServer ¶
func NewServer(Address string, Handler Handler) *MailServer
NewServer returns a MailServer struct given a listening address and a mail handler.
func (*MailServer) Run ¶
func (server *MailServer) Run()
Run starts a goroutine which listens and processes mail as it arrives.
type SingleServerSendMailer ¶
type SingleServerSendMailer struct {
Server string
}
SingleServerSendMailer sends mails via one specified SMTP server.
func NewSingleServerSendMailer ¶
func NewSingleServerSendMailer(Server string) *SingleServerSendMailer
NewSingleServerSendMailer returns a MailSender offering outgoing SMTP functionality.
func (SingleServerSendMailer) SendMail ¶
func (mailer SingleServerSendMailer) SendMail(envelope *MailEnvelope) (err error)
SendMail tries to send the given mail envelope via the configured SMTP server