This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/utils/mail.go

20 lines
439 B
Go

package utils
import (
"log/slog"
"net/smtp"
)
func SendWelcomeMail(to string) {
auth := smtp.PlainAuth("", SmtpUser, SmtpPass, SmtpHost)
msg := "From: " + SmtpFromName + " <" + SmtpFromMail + ">\nTo: " + to + "\nSubject: Welcome to me-fit\n\nWelcome to me-fit!"
err := smtp.SendMail(SmtpHost+":"+SmtpPort, auth, SmtpFromMail, []string{to}, []byte(msg))
if err != nil {
slog.Error("Could not send mail: " + err.Error())
}
}