與 golang 中已驗證的發(fā)件人身份錯誤不匹配
當(dāng)用戶注冊時,我正在處理發(fā)送的電子郵件。我正在免費使用新的 SendGrid 帳戶,但是當(dāng)我運行我的函數(shù)時,它會向我顯示以下錯誤,誰能告訴我我將如何解決它。下面是我的 Golang 函數(shù)func SendOtpMail(OTP string) (err error) { from := mail.NewEmail("Test", "test@example.com") subject := "Comfirmation Mail" to := mail.NewEmail("puneet", "puneet123@gmail.com") // plainTextContent := "" htmlContent := "Your confirmation OTP is = " + OTP message := mail.NewSingleEmail(from, subject, to, " ", htmlContent) // ("" = plainTextContent) client := sendgrid.NewSendClient("Api_key") response, err := client.Send(message) fmt.Println(response) fmt.Println(err) return err}作為回應(yīng),它將返回控制臺下方的輸出:&{403 {"errors":[{"message":"The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements","field":"from","help":null}]} map[Access-Control-Allow-Headers:[Authorization, Content-Type, On-behalf-of, x-sg-elas-acl] Access-Control-Allow-Methods:[POST] Access-Control-Allow-Origin:[https://sendgrid.api-docs.io] Access-Control-Max-Age:[600] Connection:[keep-alive] Content-Length:[281] Content-Type:[application/json] Date:[Sat, 25 Apr 2020 12:56:25 GMT] Server:[nginx] X-No-Cors-Reason:[https://sendgrid.com/docs/Classroom/Basics/API/cors.html]]}我也在 2019 年實現(xiàn)了同樣的功能,然后它正在工作,但現(xiàn)在我想更改它,然后這向我顯示了這個錯誤。這個你能幫我嗎。
查看完整描述