Versions in this module Expand all Collapse all v1 v1.0.2 May 22, 2023 v1.0.1 May 19, 2023 Changes in this version + const ErrorCharsetConversion + const ErrorCharsetDeclaration + const ErrorContentEncoding + const ErrorMalformedBase64 + const ErrorMalformedChildPart + const ErrorMalformedHeader + const ErrorMissingBoundary + const ErrorMissingContentType + const ErrorMissingRecipient + const ErrorPlainTextFromHTML + var AddressHeaders = map[string]bool + var MaxPartErrors = 0 + func AllowCorruptTextPartErrorPolicy(p *Part, err error) bool + func DecodeHeaders(b []byte, addtlHeaders ...string) (textproto.MIMEHeader, error) + func DecodeRFC2047(s string) string + func IsBase64CorruptInputError(err error) bool + func ParseAddressList(list string) ([]*mail.Address, error) + func ParseMediaType(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) + type Envelope struct + Attachments []*Part + Errors []*Error + HTML string + Inlines []*Part + OtherParts []*Part + Root *Part + Text string + func EnvelopeFromPart(root *Part) (*Envelope, error) + func ReadEnvelope(r io.Reader) (*Envelope, error) + func (e *Envelope) AddHeader(name string, value string) error + func (e *Envelope) AddressList(key string) ([]*mail.Address, error) + func (e *Envelope) Clone() *Envelope + func (e *Envelope) Date() (time.Time, error) + func (e *Envelope) DeleteHeader(name string) error + func (e *Envelope) GetHeader(name string) string + func (e *Envelope) GetHeaderKeys() (headers []string) + func (e *Envelope) GetHeaderValues(name string) []string + func (e *Envelope) SetHeader(name string, value []string) error + type Error struct + Detail string + Name string + Severe bool + func (e *Error) Error() string + func (e *Error) String() string + type MailBuilder struct + func Builder() MailBuilder + func (p *MailBuilder) GetBCC() []mail.Address + func (p *MailBuilder) GetCC() []mail.Address + func (p *MailBuilder) GetDate() time.Time + func (p *MailBuilder) GetFrom() mail.Address + func (p *MailBuilder) GetHTML() []byte + func (p *MailBuilder) GetHeader(name string) string + func (p *MailBuilder) GetReplyTo() []mail.Address + func (p *MailBuilder) GetSubject() string + func (p *MailBuilder) GetText() []byte + func (p *MailBuilder) GetTo() []mail.Address + func (p MailBuilder) AddAttachment(b []byte, contentType string, fileName string) MailBuilder + func (p MailBuilder) AddFileAttachment(path string) MailBuilder + func (p MailBuilder) AddFileInline(path string) MailBuilder + func (p MailBuilder) AddFileOtherPart(path string) MailBuilder + func (p MailBuilder) AddInline(b []byte, contentType string, fileName string, contentID string) MailBuilder + func (p MailBuilder) AddOtherPart(b []byte, contentType string, fileName string, contentID string) MailBuilder + func (p MailBuilder) BCC(name, addr string) MailBuilder + func (p MailBuilder) BCCAddrs(bcc []mail.Address) MailBuilder + func (p MailBuilder) Build() (*Part, error) + func (p MailBuilder) CC(name, addr string) MailBuilder + func (p MailBuilder) CCAddrs(cc []mail.Address) MailBuilder + func (p MailBuilder) Date(date time.Time) MailBuilder + func (p MailBuilder) Equals(o MailBuilder) bool + func (p MailBuilder) Error() error + func (p MailBuilder) From(name, addr string) MailBuilder + func (p MailBuilder) HTML(body []byte) MailBuilder + func (p MailBuilder) Header(name, value string) MailBuilder + func (p MailBuilder) RandSeed(seed int64) MailBuilder + func (p MailBuilder) ReplyTo(name, addr string) MailBuilder + func (p MailBuilder) ReplyToAddrs(replyTo []mail.Address) MailBuilder + func (p MailBuilder) Send(sender Sender) error + func (p MailBuilder) SendWithReversePath(sender Sender, from string) error + func (p MailBuilder) Subject(subject string) MailBuilder + func (p MailBuilder) Text(body []byte) MailBuilder + func (p MailBuilder) To(name, addr string) MailBuilder + func (p MailBuilder) ToAddrs(to []mail.Address) MailBuilder + type Option interface + func MaxStoredPartErrors(n int) Option + func MultipartWOBoundaryAsSinglePart(a bool) Option + func SetReadPartErrorPolicy(f ReadPartErrorPolicy) Option + func SkipMalformedParts(s bool) Option + type Parser struct + func NewParser(ops ...Option) *Parser + func (p Parser) EnvelopeFromPart(root *Part) (*Envelope, error) + func (p Parser) ReadEnvelope(r io.Reader) (*Envelope, error) + func (p Parser) ReadParts(r io.Reader) (*Part, error) + type Part struct + Boundary string + Charset string + Content []byte + ContentID string + ContentType string + ContentTypeParams map[string]string + Disposition string + Epilogue []byte + Errors []*Error + FileModDate time.Time + FileName string + FirstChild *Part + Header textproto.MIMEHeader + NextSibling *Part + OrigCharset string + Parent *Part + PartID string + func NewPart(contentType string) *Part + func ReadParts(r io.Reader) (*Part, error) + func (p *Part) AddChild(child *Part) + func (p *Part) BreadthMatchAll(matcher PartMatcher) []*Part + func (p *Part) BreadthMatchFirst(matcher PartMatcher) *Part + func (p *Part) Clone(parent *Part) *Part + func (p *Part) DepthMatchAll(matcher PartMatcher) []*Part + func (p *Part) DepthMatchFirst(matcher PartMatcher) *Part + func (p *Part) Encode(writer io.Writer) error + func (p *Part) TextContent() bool + type PartMatcher func(part *Part) bool + type ReadPartErrorPolicy func(*Part, error) bool + type SMTPSender struct + func NewSMTP(addr string, auth smtp.Auth) *SMTPSender + func (s *SMTPSender) Send(reversePath string, recipients []string, msg []byte) error + type Sender interface + Send func(reversePath string, recipients []string, msg []byte) error