mail

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mail saves generated daily reports as IONOS drafts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMessage

func BuildMessage(d Draft) ([]byte, error)

BuildMessage builds a UTF-8 HTML MIME message suitable for IMAP APPEND.

Types

type Client

type Client struct {
	Host          string
	Port          int
	UseTLS        bool
	Username      string
	Password      string
	DraftsMailbox string
}

Client appends drafts to an IMAP mailbox.

func (Client) CheckLogin

func (c Client) CheckLogin(ctx context.Context) error

CheckLogin validates that the configured IMAP credentials can authenticate.

func (Client) SaveDraft

func (c Client) SaveDraft(ctx context.Context, d Draft) error

SaveDraft appends d to the configured IONOS Drafts mailbox.

type Draft

type Draft struct {
	From    string
	To      []string
	CC      []string
	Subject string
	Body    string
	Date    time.Time
}

Draft is an email draft to be appended through IMAP.

Jump to

Keyboard shortcuts

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