Reputation: 10385
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
`
The complete code can be found on Github: https://github.com/haarts/flipco.in
Thanks for your help!
With kind regards,
Upvotes: 0
Views: 284
Reputation: 8471
What's your appid? There's a known problem that if your appid is the same as the gmail account name used to create the app, mail sending will fail. See here: http://code.google.com/p/googleappengine/issues/detail?id=5320
Upvotes: 2