Documentation
¶
Overview ¶
Package smtp provides supports for sending emails
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderPasswordResetTemplate ¶
RenderPasswordResetTemplate executes the password reset template
Types ¶
type Config ¶
type Config struct { // Location of SMTP email server. Leavy empty to disable email sending capabilities Host string `json:"host" mapstructure:"host"` // Port of SMTP email server Port int `json:"port" mapstructure:"port"` // From address, for example "SFTPGo <sftpgo@example.com>". // Many SMTP servers reject emails without a `From` header so, if not set, // SFTPGo will try to use the username as fallback, this may or may not be appropriate From string `json:"from" mapstructure:"from"` // SMTP username User string `json:"user" mapstructure:"user"` // SMTP password. Leaving both username and password empty the SMTP authentication // will be disabled Password string `json:"password" mapstructure:"password"` // 0 Plain // 1 Login // 2 CRAM-MD5 AuthType int `json:"auth_type" mapstructure:"auth_type"` // 0 no encryption // 1 TLS // 2 start TLS Encryption int `json:"encryption" mapstructure:"encryption"` // Domain to use for HELO command, if empty localhost will be used Domain string `json:"domain" mapstructure:"domain"` // Path to the email templates. This can be an absolute path or a path relative to the config dir. // Templates are searched within a subdirectory named "email" in the specified path TemplatesPath string `json:"templates_path" mapstructure:"templates_path"` }
Config defines the SMTP configuration to use to send emails
func (*Config) Initialize ¶
Initialize initialized and validates the SMTP configuration
type EmailContentType ¶
type EmailContentType int
EmailContentType defines the support content types for email body
const ( EmailContentTypeTextPlain EmailContentType = iota EmailContentTypeTextHTML )
Supported email body content type
Click to show internal directories.
Click to hide internal directories.