第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

sendgrid go 發(fā)送獲取錯(cuò)誤意外的 EOF

sendgrid go 發(fā)送獲取錯(cuò)誤意外的 EOF

Go
米琪卡哇伊 2023-07-26 17:44:53
我正在使用 go 發(fā)送郵件雜志,我嘗試使用 sendgrid 我嘗試了https://github.com/sendgrid/sendgrid-go中的示例 在 main() 上運(yùn)行一切正常示例代碼如下package mainimport (    "fmt"    "log"    "os"    "github.com/sendgrid/sendgrid-go"    "github.com/sendgrid/sendgrid-go/helpers/mail")func main() {    from := mail.NewEmail("Example User", "test@example.com")    subject := "Sending with Twilio SendGrid is Fun"    to := mail.NewEmail("Example User", "test@example.com")    plainTextContent := "and easy to do anywhere, even with Go"    htmlContent := "<strong>and easy to do anywhere, even with Go</strong>"    message := mail.NewSingleEmail(from, subject, to, plainTextContent, htmlContent)    client := sendgrid.NewSendClient(os.Getenv("SENDGRID_API_KEY"))    response, err := client.Send(message)    if err != nil {        log.Println(err)    } else {        fmt.Println(response.StatusCode)        fmt.Println(response.Body)        fmt.Println(response.Headers)    }}但我需要將 HTML 文本發(fā)送到郵件雜志所以我需要修改htmlContent := "<strong>and easy to do anywhere, even with Go</strong>"到htmlContent := "<div>some thing I want to send</div>"所以我做了以下事情func content() string {    return fmt.Sprint(`<div>many many html here</div>`)}func main() {    key := "my key of sendgrid"    send(key)}func send(key string){    from := mail.NewEmail("Example User", "test@example.com")    subject := "Sending with Twilio SendGrid is Fun"    to := mail.NewEmail("Example User", "xu1718191411@yahoo.co.jp")    plainTextContent := "and easy to do anywhere, even with Go"    htmlContent := content()    message := mail.NewSingleEmail(from, subject, to, plainTextContent, htmlContent)    client := sendgrid.NewSendClient(key)    response, err := client.Send(message)    if err != nil {        fmt.Println("==========send1 failed with",err)    }    fmt.Println("send1 result")    fmt.Println(response.StatusCode)    fmt.Println(response.Body)    fmt.Println(response.Headers)}func main() {    key := "my key here"    send(key)}
查看完整描述

1 回答

?
蕭十郎

TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超13個(gè)贊

我使用了測(cè)試帳戶(hù)。而且它每天只允許我發(fā)送 100 封郵件。我開(kāi)始付款,然后它就消失了。

怪sendgrid反應(yīng)不佳。


查看完整回答
反對(duì) 回復(fù) 2023-07-26
  • 1 回答
  • 0 關(guān)注
  • 186 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)