0
golangで添付ファイル付きのAWS SES SendRawEmailを実装する方法: 私は、golangの添付ファイルで<br> 私は次のコードで試してみましたアマゾンSES SendRawEmailを実装する必要が
session, err := session.NewSession()
svc := ses.New(session, &aws.Config{Region: aws.String("us-west-2")})
source := aws.String("XXX <[email protected]>")
destinations := []*string{aws.String("xxx <[email protected]>")}
message := ses.RawMessage{ Data: []byte(` From: xxx <[email protected]>\\nTo: xxx <[email protected]>\\nSubject: Test email (contains an attachment)\\nMIME-Version: 1.0\\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\\n\\n--NextPart\\nContent-Type: text/plain\\n\\nThis is the message body.\\n\\n--NextPart\\nContent-Type: text/plain;\\nContent-Disposition: attachment; filename=\"sample.txt\"\\n\\nThis is the text in the attachment.\\n\\n--NextPart--" `)}
input := ses.SendRawEmailInput{Source: source, Destinations: destinations, RawMessage: &message}
output, err := svc.SendRawEmail(&input)
が、私は受信メールに、それは示してい
添付ファイルの代わりに私がメッセージに与えた内容。正確に何が間違っているか分かりませんか?
構図をuは私の例を表示することができます... – A4u
'ses.RawMessage.Data'値は、添付ファイル付きの有効なメールではありません。私は電子メールの例で答えを更新しました。 – jeevatkm
'msg.WriteTo(emailRaw)'は 'msg.WriteTo(&emailRaw)'にする必要があります。 – brunetto