all repos — flounder @ 540ba027dc552c6617abebfa60a4dcb315e627a4

A small site builder for the Gemini protocol

Add activate account email notification
alex wennerberg alex@alexwennerberg.com
Sat, 12 Dec 2020 11:58:29 -0800
commit

540ba027dc552c6617abebfa60a4dcb315e627a4

parent

19a9b11438ba525f8f6115efd3e36b86e6715277

1 files changed, 20 insertions(+), 0 deletions(-)

jump to
A 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) + } +}