smtp

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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.

)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL