Google app engine Go on Google应用程序引擎返回错误:API错误1(邮件:内部错误):内部错误
我有点迷路了。通过GAE发送电子邮件似乎不起作用。引发的错误是:Google app engine Go on Google应用程序引擎返回错误:API错误1(邮件:内部错误):内部错误,google-app-engine,email,go,Google App Engine,Email,Go,我有点迷路了。通过GAE发送电子邮件似乎不起作用。引发的错误是: 无法发送电子邮件:API错误1(邮件:内部错误):内部错误 我尝试了几个不同的发件人地址,但似乎没有一致的工作。有时有效有时无效。在本地,每封邮件似乎都正常(当然没有邮件发送,但日志显示发送假设邮件)。 守则: func (coinflip *Coinflip) mailParticipants(context appengine.Context, key *datastore.Key) { participants,
无法发送电子邮件:API错误1(邮件:内部错误):内部错误
我尝试了几个不同的发件人地址,但似乎没有一致的工作。有时有效有时无效。在本地,每封邮件似乎都正常(当然没有邮件发送,但日志显示发送假设邮件)。
守则:
func (coinflip *Coinflip) mailParticipants(context appengine.Context, key *datastore.Key) {
participants, _, _ := coinflip.fetchParticipants(context)
for i := range coinflip.Participants {
msg := &mail.Message{
Sender: "X...@gmail.com",
ReplyTo: "X...@gmail.com",
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
`
完整的代码可以在Github上找到:
谢谢你的帮助
带着亲切的问候,您的appid是什么?有一个已知的问题,如果你的appid与用于创建应用程序的gmail帐户名相同,邮件发送将失败。请参见此处:对于您可以从应用内引擎发送电子邮件的电子邮件地址有限制。您是否尝试过应用程序管理员的电子邮件地址?