Documentation ¶
Index ¶
- func ConnectToSMTPServer(config *Config) (net.Conn, error)
- func ConnectToSMTPServerAdvanced(connectionInfo *SMTPConnectionInfo) (net.Conn, error)
- func NewSMTPClient(ctx context.Context, conn net.Conn, config *Config) (*smtp.Client, error)
- func NewSMTPClientAdvanced(ctx context.Context, conn net.Conn, hostname string, ...) (*smtp.Client, error)
- func SendMail(c smtpClient, mail mailData, date time.Time) error
- func SendMailUsingConfig(to, subject, htmlBody string, sendBcc bool, attachments []*Attachment, ...) error
- func SendMailWithEmbeddedFilesUsingConfig(to, subject, htmlBody string, sendBcc bool, embeddedFiles map[string]io.Reader, ...) error
- func TestConnection(config *Config) error
- type Attachment
- type Config
- type SMTPConnectionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToSMTPServer ¶
ConnectToSMTPServer connects to an SMTP server.
func ConnectToSMTPServerAdvanced ¶
func ConnectToSMTPServerAdvanced(connectionInfo *SMTPConnectionInfo) (net.Conn, error)
ConnectToSMTPServerAdvanced provides advanced SMTP server connection handling.
func NewSMTPClient ¶
NewSMTPClient returns a new SMTP client.
func NewSMTPClientAdvanced ¶
func NewSMTPClientAdvanced(ctx context.Context, conn net.Conn, hostname string, connectionInfo *SMTPConnectionInfo) (*smtp.Client, error)
NewSMTPClientAdvanced provides an SMTP client.
func SendMailUsingConfig ¶
func SendMailUsingConfig(to, subject, htmlBody string, sendBcc bool, attachments []*Attachment, config *Config) error
SendMailUsingConfig sends an email with the provided config.
func SendMailWithEmbeddedFilesUsingConfig ¶
func SendMailWithEmbeddedFilesUsingConfig(to, subject, htmlBody string, sendBcc bool, embeddedFiles map[string]io.Reader, attachments []*Attachment, config *Config) error
SendMailWithEmbeddedFilesUsingConfig sends an email with file attachments.
func TestConnection ¶
TestConnection tests the connection to the SMTP server.
Types ¶
type Config ¶
type Config struct { ReplyToName string ReplyToAddress string BCCAddresses []string SMTPUsername string SMTPPassword string SMTPServer string SMTPPort string SMTPConnectionSecurity string SMTPServerTimeout int SMTPSkipCertVerification bool }
Config contains SMTP settings for sending emails.
type SMTPConnectionInfo ¶
type SMTPConnectionInfo struct { SMTPUsername string SMTPPassword string SMTPServerName string SMTPServerHost string SMTPPort string SMTPServerTimeout int SkipCertVerification bool ConnectionSecurity string Auth bool }
SMTPConnectionInfo contains connection information for a SMTP server.
Click to show internal directories.
Click to hide internal directories.