2011-11-22 142 views
0

我有点失落。通过GAE发送电子邮件似乎不起作用。抛出的错误是: Couldn't send email: API error 1 (mail: INTERNAL_ERROR): Internal error继续Google App Engine返回错误:API错误1(邮件:INTERNAL_ERROR):内部错误

我尝试了好几种不同的发件人地址,但不似乎工作一致。有时它有时不起作用。本地每个似乎都没问题(当然没有邮件发送,但日志显示发送假设的电子邮件)。 代码:

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 
` 

的完整代码可以在Github上找到:https://github.com/haarts/flipco.in

感谢您的帮助!

祝你好运,

+0

对于可以在App Engine中发送电子邮件的电子邮件地址有限制。您是否尝试过应用程序管理员的电子邮件地址? –

回答