亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

與 golang 中已驗證的發件人身份錯誤不匹配

與 golang 中已驗證的發件人身份錯誤不匹配

Go
手掌心 2022-06-01 11:40:46
當用戶注冊時,我正在處理發送的電子郵件。我正在免費使用新的 SendGrid 帳戶,但是當我運行我的函數時,它會向我顯示以下錯誤,誰能告訴我我將如何解決它。下面是我的 Golang 函數func SendOtpMail(OTP string) (err error) {    from := mail.NewEmail("Test", "[email protected]")    subject := "Comfirmation Mail"    to := mail.NewEmail("puneet", "[email protected]")    // 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}作為回應,它將返回控制臺下方的輸出:&{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 年實現了同樣的功能,然后它正在工作,但現在我想更改它,然后這向我顯示了這個錯誤。這個你能幫我嗎。
查看完整描述

3 回答

?
慕森王

TA貢獻1777條經驗 獲得超3個贊

由于這是 sendgrid 為保護您的發送聲譽和維護合法發送行為而創建的新設置,因此他們要求客戶驗證其發件人身份。由于這些舊的 sendgrid 帳戶不會受到影響,因此 2020 年 4 月 6 日之后創建的帳戶將能夠進行發件人驗證。

檢查此文檔以獲取信息 - https://sendgrid.com/docs/ui/sending-email/sender-verification


查看完整回答
反對 回復 2022-06-01
?
湖上湖

TA貢獻2003條經驗 獲得超2個贊

根據 sendgrid 提供的文檔。在發送任何電子郵件之前,您應該對發件人進行身份驗證,

有兩種方法可以做到

  1. 域認證

  2. 單一發件人身份驗證

請按照以下鏈接進行單發件人身份驗證

https://sendgrid.com/docs/ui/sending-email/sender-verification


查看完整回答
反對 回復 2022-06-01
?
揚帆大魚

TA貢獻1799條經驗 獲得超9個贊

  • 驗證您的電子郵件

  • 重啟你的服務器

  • 如果仍然存在錯誤,則輸入 DEFAULT_FROM_EMAIL = [email protected] [email protected]

  • 重新啟動服務器,錯誤應該消失了


http://img1.sycdn.imooc.com//6296dfe70001669312410202.jpg

查看完整回答
反對 回復 2022-06-01
  • 3 回答
  • 0 關注
  • 272 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號