mail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

CLAUDE:SUMMARY Shared SMTP mail service: STARTTLS + LOGIN auth (OVH), password reset, verification emails. CLAUDE:DEPENDS log/slog, net/smtp, crypto/tls CLAUDE:EXPORTS Config, Service, NewService

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	From     string
	AppName  string // Used in email subjects/bodies (e.g. "SiftRAG", "repvow")
}

Config holds SMTP connection parameters.

type Service

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

Service sends emails via SMTP with STARTTLS and LOGIN auth.

func NewService

func NewService(cfg Config) *Service

NewService creates a mail service. If Host is empty, the service is disabled and Send calls will log a warning and return nil.

func (*Service) Enabled

func (s *Service) Enabled() bool

Enabled returns true if SMTP host is configured.

func (*Service) Send

func (s *Service) Send(to, subject, body string) error

Send delivers a plain-text email via SMTP STARTTLS with LOGIN auth.

func (*Service) SendPasswordReset

func (s *Service) SendPasswordReset(to, baseURL, token string) error

SendPasswordReset sends a password reset email with a tokenized link.

func (*Service) SendVerification

func (s *Service) SendVerification(to, baseURL, token string) error

SendVerification sends an email verification link.

Jump to

Keyboard shortcuts

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