flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 540ba027dc552c6617abebfa60a4dcb315e627a4
parent 19a9b11438ba525f8f6115efd3e36b86e6715277
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 12 Dec 2020 11:58:29 -0800

Add activate account email notification

Diffstat:
Amail.go | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/mail.go b/mail.go @@ -0,0 +1,20 @@ +package main + +import ( + "log" + "net/smtp" +) + +func SendEmail(email string, subject string, body string) { + auth := smtp.PlainAuth("", c.SMTPUsername, c.SMTPPassword, "smtp.migadu.com") + msg := "From: " + c.SMTPUsername + "\n" + + "To: " + email + "\n" + + "Cc: " + c.SMTPUsername + "\n" + + "Subject:" + subject + "\n" + + body + err := smtp.SendMail(c.SMTPServer, auth, c.SMTPUsername, []string{email}, []byte(msg)) + if err != nil { + // doesnt need to block anything i think + log.Println(err) + } +}