mail

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mail parses inbound MIME messages and sends outbound mail via SMTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Filename    string `json:"filename"`
	ContentType string `json:"contentType"`
	Size        int    `json:"size"`
}

Attachment is metadata for a non-inline message part.

type Message

type Message struct {
	From    string
	To      []string
	Subject string
	Text    string
	HTML    string
}

Message is an outbound email.

type Parsed

type Parsed struct {
	MessageID   string
	From        string
	To          string
	Subject     string
	Text        string
	HTML        string
	Attachments []Attachment
	ReceivedAt  time.Time
	Raw         []byte
}

Parsed is the normalized result of reading a raw RFC822 message.

func Parse

func Parse(raw []byte) (*Parsed, error)

Parse reads a raw email and extracts the fields led stores.

type SMTPSender

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

SMTPSender relays through a configured SMTP server.

func (*SMTPSender) Send

func (s *SMTPSender) Send(m Message) error

type Sender

type Sender interface {
	Send(m Message) error
}

Sender delivers outbound mail. Implemented today by an SMTP relay.

func NewCustomSender

func NewCustomSender(host, port, user, pass, from string) Sender

NewCustomSender builds a Sender from explicit credentials.

Jump to

Keyboard shortcuts

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