boulder: Index | Files

package mail

import ""


Package Files


type Mailer Uses

type Mailer interface {
    SendMail([]string, string, string) error
    Connect() error
    Close() error

Mailer provides the interface for a mailer

type MailerImpl Uses

type MailerImpl struct {
    // contains filtered or unexported fields

MailerImpl defines a mail transfer agent to use for sending mail. It is not safe for concurrent access.

func New Uses

func New(
    password string,
    rootCAs *x509.CertPool,
    from mail.Address,
    logger blog.Logger,
    stats prometheus.Registerer,
    reconnectBase time.Duration,
    reconnectMax time.Duration) *MailerImpl

New constructs a Mailer to represent an account on a particular mail transfer agent.

func NewDryRun Uses

func NewDryRun(from mail.Address, logger blog.Logger) *MailerImpl

New constructs a Mailer suitable for doing a dry run. It simply logs each command that would have been run, at debug level.

func (*MailerImpl) Close Uses

func (m *MailerImpl) Close() error

Close closes the connection.

func (*MailerImpl) Connect Uses

func (m *MailerImpl) Connect() error

Connect opens a connection to the specified mail server. It must be called before SendMail.

func (*MailerImpl) SendMail Uses

func (m *MailerImpl) SendMail(to []string, subject, msg string) error

SendMail sends an email to the provided list of recipients. The email body is simple text.

type RecoverableSMTPError Uses

type RecoverableSMTPError struct {
    Message string

RecoverableSMTPError is returned by SendMail when the server rejects a message but for a reason that doesn't prevent us from continuing to send mail. The error message contains the error code and the error message returned from the server.

func (RecoverableSMTPError) Error Uses

func (e RecoverableSMTPError) Error() string

Package mail imports 21 packages (graph) and is imported by 63 packages. Updated 2020-04-21. Refresh now. Tools for package owners.