2011-11-22 139 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中發送電子郵件的電子郵件地址有限制。您是否嘗試過應用程序管理員的電子郵件地址? –

回答