I m a bit lost. Sending email via GAE does not appear to work. The error thrown is:
Couldn t send email: API error 1 (mail: INTERNAL_ERROR): Internal error
I have tried several different Sender addresses but non seem to work consistently. Sometimes it works sometimes it doesn t. Locally every seems OK (no mail send of course but the log shows send hypothetical emails). The code:
func (coinflip *Coinflip) mailParticipants(context appengine.Context, key *datastore.Key) {
participants, _, _ := coinflip.fetchParticipants(context)
for i := range coinflip.Participants {
msg := &mail.Message{
Sender: "[email protected]",
ReplyTo: "[email protected]",
To: []string{participants[i].Email},
Subject: "What will it be? " + coinflip.Head + " or " + coinflip.Tail + "?",
Body: fmt.Sprintf(confirmMessage, "http://www.flipco.in/register/" + key.Encode() + "?email=" + participants[i].Email),
}
if err := mail.Send(context, msg); err != nil {
context.Errorf("Couldn t send email: %v", err)
}
}
}
const confirmMessage = `
Someone created a coin toss with you.
Please confirm your email address by clicking on the link below:
%s
`
完整的法典可在以下网址查阅:。
感谢你们的帮助!
类型