Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements the smtp.Backend interface required by go-smtp
type Email ¶
type Email struct {
// Unique identifier for the email
ID string `json:"id"`
// Sender's email address
From string `json:"from"`
// List of recipient email addresses
To []string `json:"to"`
// Carbon copy recipients
Cc []string `json:"cc"`
// Blind carbon copy recipients
Bcc []string `json:"bcc"`
// Reply-to email address
ReplyTo string `json:"replyTo"`
// Email subject line
Subject string `json:"subject"`
// Plain text content of the email
Body string `json:"body"`
// HTML content of the email, if available
HTML string `json:"html"`
// Time when the email was received
Timestamp time.Time `json:"timestamp"`
// Raw email content in its original form
Raw string `json:"raw"`
// Additional headers
Headers map[string][]string `json:"headers"`
}
Email represents a received email message with all its components
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents our SMTP server implementation It handles email reception and storage in memory
func NewServer ¶
NewServer creates and configures a new SMTP server instance Parameters:
- host: The hostname or IP to listen on
- port: The port number to listen on
- auth: Authentication mode
- username: Authentication username
- password: Authentication password
- tlsMode: TLS configuration mode
func (*Server) EmailsChan ¶
EmailsChan returns the channel used for real-time email notifications Consumers can listen on this channel to receive new emails as they arrive
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an active SMTP session with a client
func (*Session) Data ¶
Data handles the DATA command in the SMTP protocol It receives the email content and processes it
func (*Session) Mail ¶
func (s *Session) Mail(from string, opts *smtp.MailOptions) error
Mail handles the MAIL FROM command in the SMTP protocol