sender

package
v0.0.0-...-c7a0b58 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Send = send

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

LoginAuth SMTP AUTH LOGIN Auth Handler

func NtlmAuth

func NtlmAuth(username, password string) smtp.Auth

NtlmAuth SMTP AUTH NTLM Auth Handler

Types

type DummySender

type DummySender struct{}

DummySender Sender sendmail mail sender

func (*DummySender) Send

func (s *DummySender) Send(from string, to []string, msg io.WriterTo) error

Send send email

type Message

type Message struct {
	Info            string // Message information for log purpose.
	FromAddress     string
	FromDisplayName string
	To              string // Use only one recipient to prevent leaking of addresses
	ReplyTo         string
	Subject         string
	Date            time.Time
	Body            string
	Headers         map[string][]string
}

Message mail body and log info

func NewMessage

func NewMessage(to, subject, body string) *Message

NewMessage creates new mail message object with default From header.

func NewMessageFrom

func NewMessageFrom(to, fromDisplayName, fromAddress, subject, body string) *Message

NewMessageFrom creates new mail message object with custom From header.

func (*Message) SetHeader

func (m *Message) SetHeader(field string, value ...string)

SetHeader adds additional headers to a message

func (*Message) ToMessage

func (m *Message) ToMessage() *gomail.Msg

ToMessage converts a Message to gomail.Message

type SMTPSender

type SMTPSender struct{}

SMTPSender Sender SMTP mail sender

func (*SMTPSender) Send

func (s *SMTPSender) Send(from string, to []string, msg io.WriterTo) error

Send send email

type Sender

type Sender interface {
	Send(from string, to []string, msg io.WriterTo) error
}

type SendmailSender

type SendmailSender struct{}

SendmailSender Sender sendmail mail sender

func (*SendmailSender) Send

func (s *SendmailSender) Send(from string, to []string, msg io.WriterTo) error

Send send email

Jump to

Keyboard shortcuts

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