go-gomail / gomail

The best way to send emails in Go.
MIT License
4.4k stars 580 forks source link

Recipient address rejected: Email Sending Quota Exceeded #174

Open HardCodeProgrammer opened 2 years ago

HardCodeProgrammer commented 2 years ago

I'm trying to send a mail using gomail. It was working well. I did send many test mails to my gmail (to check how email template renders) and now I got this error. I tried sending test mails to a different mail id (my yahoo.com mail) but I get the same error.

What does this error actually mean. Is there a problem in the recipient address or in my server's code (sender). If the problem lies in the recipient address (as the error message says) then why am I not able to send mails to a completely different address. Also what is this sending quota and how to increase it ?

What I already checked

  1. My inboxes (of both sending and receiving mail addresses) are no where close to full.
  2. Other normal mails (sent manually from some email client) works (no issues in any mail configurations [SMTP/POP3 etc.])

Not forgetting the code

func SendMail(mail_options map[interface{}]interface{}) {

    from := mail_options["from"].(string)
    pass := mail_options["password"].(string)
    to := mail_options["to"].([]string)

    host := mail_options["host"].(string)
    port := 587

    subject := mail_options["subject"].(string)
    mail_body := mail_options["body"].(string)

    msg := gomail.NewMessage()

    msg.SetHeader("From", from)
    msg.SetHeader("To", to...)

    msg.SetHeader("Subject", subject)

    msg.SetBody("text/html", mail_body)

    // msg.attach("/path/to/file")

    mail := gomail.NewDialer(host, port, from, pass)

    err := mail.DialAndSend(msg)

    if err != nil {
        fmt.Println("ERROR: in sending mail")
        utils.LogError(err) // A working function to log errors to a file.
    }
}

Full Error Message

ERROR: 2022/09/01 10:26:39 logger.go:27: gomail: could not send email 1: 550 5.4.6 <my_email@yahoo.com>: Recipient address rejected: Email Sending Quota Exceeded

Someone please help 🙏🙏