smtpclient

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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