mail

package
v0.0.0-...-f8b4945 Latest Latest
Warning

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

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

Documentation

Overview

Package mail builds and sends a multipart (text + HTML) email.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMessage

func BuildMessage(h Header, text, html string) []byte

BuildMessage returns RFC 5322 bytes with a multipart/alternative body containing the plain-text and HTML versions.

func Send

func Send(s SMTP, h Header, msg []byte) error

Send delivers msg to the recipient using PLAIN auth over the SMTP server.

Types

type Header struct {
	From    string
	To      string
	Subject string
}

Header carries the envelope fields for a message.

type SMTP

type SMTP struct {
	Host string
	Port string
	User string
	Pass string
}

SMTP holds connection settings for sending.

Jump to

Keyboard shortcuts

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