smtpclient

package
v3.15.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SMTPCredentials

type SMTPCredentials struct {
	SenderLogin    string `docs:";The login to be used by sender."                    mapstructure:"sender_login"`
	SenderMail     string `docs:";The email to be used to send mails."                mapstructure:"sender_mail"`
	SenderPassword string `docs:";The sender's password."                             mapstructure:"sender_password"`
	SMTPServer     string `docs:";The hostname of the SMTP server."                   mapstructure:"smtp_server"`
	SMTPPort       int    `docs:"587;The port on which the SMTP daemon is running."   mapstructure:"smtp_port"`
	DisableAuth    bool   `docs:"false;Whether to disable SMTP auth."                 mapstructure:"disable_auth"`
	LocalName      string `docs:";The host name to be used for unauthenticated SMTP." mapstructure:"local_name"`
}

SMTPCredentials stores the credentials required to connect to an SMTP server.

func NewSMTPCredentials

func NewSMTPCredentials(c *SMTPCredentials) *SMTPCredentials

NewSMTPCredentials creates a new SMTPCredentials object with the details of the passed object with sane defaults.

func (*SMTPCredentials) SendMail

func (creds *SMTPCredentials) SendMail(recipient, subject, body string) error

SendMail allows sending mails using a set of client credentials.

Jump to

Keyboard shortcuts

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