Help us shape the future of Go! Take the 2026 Go Developer Survey

mail

package
v1.20.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is the fluent builder returned by NewMessage.

func NewMessage

func NewMessage() *Builder

NewMessage returns a fluent builder for a MailMessage. Every method returns the same builder so calls can be chained; call Build() to finish.

func (n *InvoicePaid) ToMail(_ notification.Notifiable) notification.MailMessage {
    return mail.NewMessage().
        Subject("Invoice Paid").
        Html("<p>Thanks!</p>").
        Build()
}

func (*Builder) Attach

func (b *Builder) Attach(paths ...string) *Builder

func (*Builder) Build

Build returns the finished MailMessage.

func (*Builder) From

func (b *Builder) From(address string) *Builder

func (*Builder) Header

func (b *Builder) Header(key, value string) *Builder

func (*Builder) Html

func (b *Builder) Html(html string) *Builder

func (*Builder) HtmlView

func (b *Builder) HtmlView(view string, with map[string]any) *Builder

func (*Builder) ReplyTo

func (b *Builder) ReplyTo(address string) *Builder

func (*Builder) Subject

func (b *Builder) Subject(subject string) *Builder

func (*Builder) Text

func (b *Builder) Text(text string) *Builder

func (*Builder) TextView

func (b *Builder) TextView(view string, with map[string]any) *Builder

func (*Builder) To

func (b *Builder) To(addresses ...string) *Builder

Jump to

Keyboard shortcuts

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