电子邮件组的Golang smtp SendMail失败

时间:2016-08-18 17:22:59

标签: go smtp

我使用的是Golang的smtp软件包,如果该电子邮件是包含10个左右的人的Google电子邮件群组,则无法发送电子邮件。如果我只是通过电子邮件发送给单个Gmail收件人,它就能完美运行我不知道从哪里开始寻找。看起来他们在API文档中没有任何内容。

auth := smtp.PlainAuth(
    "",
    "erased for privacy reasons...",
    "erased for privacy reasons...",
    "smtp.gmail.com",
)
msg := []byte(
    "To: " + *email + "\r\n" +
        "Subject: External health check failure!\r\n\r\n" +
        "some stuff:\n\n" + "\r\n")
smtpErr := smtp.SendMail(
    "smtp.gmail.com:587",
    auth,
    "",
    []string{"erased for privacy reasons..."},
    msg,
)
if smtpErr != nil {
    fmt.Fprintf(os.Stderr, "Email alert failed with the following error: %v\n", smtpErr)
}

0 个答案:

没有答案