mirror of
https://github.com/Dvorinka/SendMail.git
synced 2026-07-29 01:53:47 +00:00
git push
This commit is contained in:
@@ -20,13 +20,16 @@ type FormData struct {
|
||||
type EmailConfig struct {
|
||||
Email string
|
||||
Password string
|
||||
SMTPHost string
|
||||
SMTPPort int
|
||||
}
|
||||
|
||||
var domainMap = map[string]EmailConfig{
|
||||
"tdvorak.dev": {"[email protected]", "%8s3Yad*!b3*t"},
|
||||
"vbly.org": {"[email protected]", "!N0^e0Q9k*mV"},
|
||||
"sportcreative.eu": {"[email protected]", "@dN$TZPgG5!"},
|
||||
"reklik.net": {"[email protected]", "FK8eAwJbSkP2%H"},
|
||||
"tdvorak.dev": {"[email protected]", "%8s3Yad*!b3*t", "smtp.purelymail.com", 465},
|
||||
"vbly.org": {"[email protected]", "!N0^e0Q9k*mV", "smtp.purelymail.com", 465},
|
||||
"sportcreative.eu": {"[email protected]", "@dN$TZPgG5!", "smtp.purelymail.com", 465},
|
||||
"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) {
|
||||
@@ -54,8 +57,8 @@ func sendHandler(w http.ResponseWriter, r *http.Request) {
|
||||
m.SetHeader("Subject", data.Subject)
|
||||
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.SSL = true // Purelymail recommends SSL on port 465
|
||||
d := gomail.NewDialer(config.SMTPHost, config.SMTPPort, config.Email, config.Password)
|
||||
d.SSL = true // Using SSL for secure connection
|
||||
|
||||
if err := d.DialAndSend(m); err != nil {
|
||||
log.Println("Email send error:", err)
|
||||
|
||||
Reference in New Issue
Block a user