fix mailer go

This commit is contained in:
Jonathan Martz
2025-01-12 19:22:11 +01:00
parent d92bff0357
commit 7c2253c896

View File

@@ -6,7 +6,6 @@ import (
"flag" "flag"
"fmt" "fmt"
"log" "log"
"math/rand"
"net/smtp" "net/smtp"
"os/exec" "os/exec"
"time" "time"
@@ -83,8 +82,7 @@ func main() {
} }
// Prepare the email body // Prepare the email body
messageID := fmt.Sprintf("<%d.%d@%s>", now.UnixNano(), rand.Int(), smtpHost) emailBody := fmt.Sprintf("Subject: %s\r\n\r\n%s", subject, string(countsJSON))
emailBody := fmt.Sprintf("Subject: %s\r\n\r\n Message-ID: %s \r\n\r\n %s", subject, messageID, string(countsJSON))
// Connect to the SMTP server // Connect to the SMTP server
auth := smtp.PlainAuth("", *smtpUser, *smtpPass, smtpHost) auth := smtp.PlainAuth("", *smtpUser, *smtpPass, smtpHost)