Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMultipartMessage ¶
func BuildMultipartMessage(fromAddress string, toAddresses []string, subject string, htmlBody string, textBody string) (string, error)
BuildMultipartMessage constructs a MIME multipart email message with both HTML and text parts
func SanitizeForEmail ¶
SanitizeForEmail restricts to safe characters for email (alphanumerics, dash, dot, slash, colon, at, underscore). It removes any character not matching the safe set and explicitly strips CRLF characters to prevent header injection.
Types ¶
type EmailClient ¶
type EmailClient struct {
// contains filtered or unexported fields
}
EmailClient wraps the SMTP client functionality
func ConnectSMTP ¶
func ConnectSMTP(ctx context.Context, config models.EmailConfig) (*EmailClient, error)
ConnectSMTP establishes a connection to the SMTP server based on the TLS mode
func (*EmailClient) SendMessage ¶
func (ec *EmailClient) SendMessage(fromAddress string, toAddresses []string, message string) error
SendMessage sends an email message through the SMTP client
Click to show internal directories.
Click to hide internal directories.