mail

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mail provides a simple util for sending mail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	// contains filtered or unexported fields
}

Mail represents a mail entity.

func New

func New() *Mail

New creates a new mail.

func (*Mail) AddData

func (a *Mail) AddData(name string, r io.Reader) error

AddData adds a data part.

func (*Mail) AddFile

func (a *Mail) AddFile(filename string) error

AddFile adds a file part.

func (*Mail) AddHTML

func (a *Mail) AddHTML(s string) error

AddHTML adds a html part.

func (*Mail) AddText

func (a *Mail) AddText(s string) error

AddText adds a text part.

func (*Mail) Bcc

func (a *Mail) Bcc(bcc ...string) *Mail

Bcc sets the bcc field.

func (*Mail) Cc

func (a *Mail) Cc(cc ...string) *Mail

Cc sets the cc field.

func (*Mail) From

func (a *Mail) From(from string) *Mail

From sets the from field.

func (*Mail) Send

func (a *Mail) Send(addr string, auth smtp.Auth) error

Send sends the mail.

func (*Mail) Subject

func (a *Mail) Subject(subject string) *Mail

Subject sets the subject field.

func (*Mail) To

func (a *Mail) To(to ...string) *Mail

To sets the to field.

func (*Mail) WithPart

func (a *Mail) WithPart(header textproto.MIMEHeader, f func(io.Writer) error) error

WithPart creates a new multipart section with the provided header.

Jump to

Keyboard shortcuts

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