Documentation
¶
Overview ¶
Package smtpclient provides an SMTP client with TLS and STARTTLS support, multiple authentication methods (PLAIN, LOGIN, CRAM-MD5), configurable retry with exponential backoff, and multipart email composition with attachments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment represents an email attachment
func AttachFile ¶
func AttachFile(path string) (Attachment, error)
AttachFile opens the file at path and returns an Attachment ready for use in an Email.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an SMTP client
type Email ¶
type Email struct {
From string
To []string
CC []string
BCC []string
Subject string
HTMLBody string
TextBody string
Attachments []Attachment
Headers map[string]string
}
Email represents an email message
type Option ¶
type Option func(*Client)
Option configures the client
func WithAuthType ¶
WithAuthType sets the authentication type
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() Option
WithInsecureSkipVerify skips TLS certificate verification (not recommended for production)
func WithTLSConfig ¶
WithTLSConfig sets custom TLS configuration
func WithTimeout ¶
WithTimeout sets the connection timeout