SendMessage (email/email.go)

pingme · service/email/email.go · go · MIT
email

Sends emails via SMTP using notify, supporting multiple recipients and configurable options.

// Source: https://github.com/kha7iq/pingme | License: MIT | Copyright 2021 Abdul Khaliq <a.khaliq@outlook.my>
// Provided via justclaw.it.com; keep this notice with the code.
package email

import (
	"context"
	"fmt"
	"log"
	"strings"

	"github.com/kha7iq/pingme/service/helpers"

	"github.com/nikoksr/notify"
	"github.com/nikoksr/notify/service/mail"
	"github.com/urfave/cli/v2"
)

// email struct holds data parsed via flags for email service.
type email struct {
	SenderAddress   string
	Password        string
	Host            string
	ReceiverAddress string
	Subject         string
	Message         string
	Port            string
	Identity        string
}

// SendMessage sends an email to multiple receivers.
// receivers can be comma-separated string of email addresses.
func SendMessage(sende

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

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

Get a free API key