Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSmtpEmailSender ¶
func NewSmtpEmailSender(host string, port int, user, password string, authMethod AuthMethod) (*smtpEmailSender, error)
NewSmtpEmailSender creates a new instance of smtpEmailSender. It initializes the SMTP email sender with the provided SMTP server settings.
Parameters:
- host: The SMTP server host (e.g., "smtp.example.com").
- port: The SMTP server port (e.g., 587).
- user: The username for authentication.
- password: The password for authentication.
- authMethod: The authentication method to use (AUTH_CRAM_MD5, AUTH_PLAIN).
Returns:
- *smtpEmailSender: A pointer to the initialized smtpEmailSender.
- error: An error if the initialization fails, otherwise nil.
func NewSmtpEmailSenderWithConnMethod ¶
func NewSmtpEmailSenderWithConnMethod(host string, port int, user, password string, authMethod AuthMethod, connectionMethod ConnectionMethod) (*smtpEmailSender, error)
NewSmtpEmailSenderWithConnMethod creates a new instance of smtpEmailSender. It initializes the SMTP email sender with the provided SMTP server settings.
Parameters:
- host: The SMTP server host (e.g., "smtp.example.com").
- port: The SMTP server port (e.g., 587).
- user: The username for authentication.
- password: The password for authentication.
- authMethod: The authentication method to use (AUTH_CRAM_MD5, AUTH_PLAIN).
- connectionMethod: The connection method to use (CONN_IMPLICIT, CONN_TLS).
Returns:
- *smtpEmailSender: A pointer to the initialized smtpEmailSender.
- error: An error if the initialization fails, otherwise nil.
Types ¶
type AuthMethod ¶
type AuthMethod string
AuthMethod defines the authorization method for SMTP.
const ( AUTH_CRAM_MD5 AuthMethod = "CRAM-MD5" // CRAM-MD5 authentication method. AUTH_PLAIN AuthMethod = "PLAIN" // Plain authentication method. )
type ConnectionMethod ¶
type ConnectionMethod string
const ( CONN_IMPLICIT ConnectionMethod = "IMPLICIT" // IMPLICIT TLS authentication method. CONN_TLS ConnectionMethod = "TLS" // TLS authentication method. )
Click to show internal directories.
Click to hide internal directories.