String (smtp/smtp.go)

goreleaser · internal/pipe/smtp/smtp.go · go · MIT
email

Sends release announcements via SMTP, configurable with env variables.

// Source: https://github.com/goreleaser/goreleaser | License: MIT | Copyright 2016-2026 Carlos Alexandro Becker
// Provided via justclaw.it.com; keep this notice with the code.
// Package smtp announces releases via SMTP.
package smtp

import (
	"crypto/tls"
	"errors"
	"fmt"

	"github.com/caarlos0/env/v11"
	"github.com/caarlos0/log"
	"github.com/goreleaser/goreleaser/v2/internal/tmpl"
	"github.com/goreleaser/goreleaser/v2/pkg/config"
	"github.com/goreleaser/goreleaser/v2/pkg/context"
	gomail "gopkg.in/mail.v2"
)

const (
	defaultSubjectTemplate = `{{ .ProjectName }} {{ .Tag }} is out!`
	defaultBodyTemplate    = `You can view details from: {{ .ReleaseURL }}`
)

type Pipe struct{}

func (Pipe) String() string { return "smtp" }
func (Pipe) Skip(ctx *context.Context) (bool, error) {
	enable, 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key