Versions in this module Expand all Collapse all v0 v0.0.1 Mar 4, 2026 Changes in this version + var ErrAlreadyInitialized = errors.New("client is already initialized") + var ErrInvalidConfig = errors.New("invalid config") + var ErrInvalidParams = errors.New("invalid params") + var ErrNotRunning = errors.New("client is not running") + type AttachmentInfo struct + AttachmentName string + AttachmentReader io.Reader + type BodyContentType = string + const BodyContentTypeHtml + const BodyContentTypeText + type Client struct + Status ClientStatus + func NewClient(cfg *Config) (*Client, error) + func (c *Client) Send(ctx context.Context, msg *SendMailMessage) error + func (c *Client) StartWithHandler(ctx context.Context, ...) error + func (c *Client) Stop(ctx context.Context) error + type ClientStatus string + const ClientStatusAbnormal + const ClientStatusInit + const ClientStatusIniting + const ClientStatusRunning + const ClientStatusStopped + type Config struct + AttachmentDir string + AttachmentMaxBytes int64 + BodyMaxBytes int64 + CheckInterval int + ConnectWithID bool + ForcedPolling bool + IMAPPort int + IMAPServer string + Mailbox string + Password string + SMTPPort int + SMTPServer string + SMTPUseTLS bool + UseTLS bool + Username string + type MailAttachment struct + AttachmentName string + IsParsed bool + LocalPath string + ParseError error + SafeAttachmentName string + type MailBodyPart struct + Body string + ContentType BodyContentType + IsParsed bool + ParseError error + type MailMessage struct + Attachments []*MailAttachment + BodyParts []*MailBodyPart + From string + Subject string + To string + UID uint32 + type SendMailMessage struct + Attachments []*AttachmentInfo + Body []string + Subject string + To string