以下是我嘗試發送的帶有附件的代碼。 msg := &mail.Message{ Sender: "[email protected]", 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) }當我嘗試保存代碼時,將引發錯誤。錯誤:cannot use []Attachment literal (type []Attachment) as type []"google.golang.org/appengine/mail".Attachment in field value
- 1 回答
- 0 關注
- 251 瀏覽
添加回答
舉報
0/150
提交
取消