httpmail

package module
v0.0.0-...-d1ea240 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: GPL-3.0 Imports: 8 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Library for configuring mail client and sending mail using HTTP templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendMail

func SendMail(sender MailSender, destination, subject string, view *httpview.View, data any) error

Function for sending mail. Uses values from CfgMail struct to connect to the mail server. User must provide sender information, recipient email, message subject, httpview.View (containing Text and HTML templates), and data to populate those templates

Types

type CfgMail

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

A configuration struct for the mail server, populated from environment variables.

func (*CfgMail) Config

func (cfg *CfgMail) Config() error

This method configures mail server by reading values from the following environment variables: - SMTP_USER - smtp username; - SMTP_PASSWORD - smtp password; - SMTP_PORT - smtp server port; - SMTP_DOMAIN - smtp server domain; - SMTP_AUTH_TYPE - authentication type, must be string value of SMTPAuthType from github.com/wneessen/go-mail. Default is SMTPAuthAutoDiscover. - SMTP_TLS - smtp tls settings, must be string value of TLSPolicy from github.com/wneessen/go-mail. Default is TLSMandatory.

type MailIdentity

type MailIdentity struct {
	Name string
	Mail string
}

Holds name displayed in email client and an email address

type MailSender

type MailSender struct {
	From    MailIdentity
	ReplyTo MailIdentity
}

Holds From and ReplyTo MailIdentity structs for the sender.

Jump to

Keyboard shortcuts

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