flounder

A simple gemini site builder
git clone git://git.alexwennerberg.com/flounder
Log | Files | Refs | README | LICENSE

mail.go (464B) - raw


      1 package main
      2 
      3 import (
      4 	"log"
      5 	"net/smtp"
      6 )
      7 
      8 func SendEmail(email string, subject string, body string) {
      9 	auth := smtp.PlainAuth("", c.SMTPUsername, c.SMTPPassword, "smtp.migadu.com")
     10 	msg := "From: " + c.SMTPUsername + "\n" +
     11 		"To: " + email + "\n" +
     12 		"Subject:" + subject + "\n" +
     13 		body
     14 	err := smtp.SendMail(c.SMTPServer, auth, c.SMTPUsername, []string{email}, []byte(msg))
     15 	if err != nil {
     16 		// doesnt need to block anything i think
     17 		log.Println(err)
     18 	}
     19 }