以下是我嘗試發(fā)送的帶有附件的代碼。 msg := &mail.Message{ Sender: "kasireddy002@gmail.com", To: []string{addr}, Attachments : []Attachment{ Name :"file name", Data :[]byte, ContentID :"fileid", }, Subject: "Welcome to Simplyst Health: Verify your account", if err := mail.Send(context, msg); err != nil { log.Errorf(ctx, "Alas, my user, the email failed to sendeth: err) }當(dāng)我嘗試保存代碼時(shí),將引發(fā)錯(cuò)誤。錯(cuò)誤:cannot use []Attachment literal (type []Attachment) as type []"google.golang.org/appengine/mail".Attachment in field value
- 1 回答
- 0 關(guān)注
- 252 瀏覽
添加回答
舉報(bào)
0/150
提交
取消