This commit is contained in:
Dvorinka
2025-08-12 15:16:16 +02:00
parent 72fc6d84ec
commit d9e2b521d0
+9 -6
View File
@@ -20,13 +20,16 @@ type FormData struct {
type EmailConfig struct { type EmailConfig struct {
Email string Email string
Password string Password string
SMTPHost string
SMTPPort int
} }
var domainMap = map[string]EmailConfig{ var domainMap = map[string]EmailConfig{
"tdvorak.dev": {"[email protected]", "%8s3Yad*!b3*t"}, "tdvorak.dev": {"[email protected]", "%8s3Yad*!b3*t", "smtp.purelymail.com", 465},
"vbly.org": {"[email protected]", "!N0^e0Q9k*mV"}, "vbly.org": {"[email protected]", "!N0^e0Q9k*mV", "smtp.purelymail.com", 465},
"sportcreative.eu": {"[email protected]", "@dN$TZPgG5!"}, "sportcreative.eu": {"[email protected]", "@dN$TZPgG5!", "smtp.purelymail.com", 465},
"reklik.net": {"[email protected]", "FK8eAwJbSkP2%H"}, "reklik.net": {"[email protected]", "FK8eAwJbSkP2%H", "smtp.purelymail.com", 465},
"zeusport.eu": {"[email protected]", "r-:#sSQ?9D%C4t8", "smtp.forpsi.com", 465},
} }
func sendHandler(w http.ResponseWriter, r *http.Request) { func sendHandler(w http.ResponseWriter, r *http.Request) {
@@ -54,8 +57,8 @@ func sendHandler(w http.ResponseWriter, r *http.Request) {
m.SetHeader("Subject", data.Subject) m.SetHeader("Subject", data.Subject)
m.SetBody("text/plain", "Name: "+data.Name+"\nEmail: "+data.Email+"\n\n"+data.Message) m.SetBody("text/plain", "Name: "+data.Name+"\nEmail: "+data.Email+"\n\n"+data.Message)
d := gomail.NewDialer("smtp.purelymail.com", 465, config.Email, config.Password) d := gomail.NewDialer(config.SMTPHost, config.SMTPPort, config.Email, config.Password)
d.SSL = true // Purelymail recommends SSL on port 465 d.SSL = true // Using SSL for secure connection
if err := d.DialAndSend(m); err != nil { if err := d.DialAndSend(m); err != nil {
log.Println("Email send error:", err) log.Println("Email send error:", err)