2009-05-25 9 views
1

私のGoogleアプリケーションエンジンアプリケーションはメールを送信する必要があります(画面からデータを取得するまで)。開発サーバーでは、サーバーを起動するときに自分のsmtp構成(ホスト、ポート、ユーザー、パスワード)を指定します。私はSMTPServerDisconnected issue

**Traceback (most recent call last): 
    File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 500, in __call__ 
    handler.post(*groups) 
    File "C:\Documents and Settings\desk\Desktop\apps\temp\main.py", line 139, in post 
    """) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\mail.py", line 205, in send_mail 
    message.send(make_sync_call) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\mail.py", line 474, in send 
    make_sync_call('mail', self._API_CALL, message, response) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 68, in MakeSyncCall 
    apiproxy.MakeSyncCall(service, call, request, response) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 240, in MakeSyncCall 
    stub.MakeSyncCall(service, call, request, response) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub.py", line 80, in MakeSyncCall 
    method(request, response) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\mail_stub.py", line 203, in _Send 
    self._SendSMTP(mime_message, smtp_lib) 
    File "C:\Program Files\Google\google_appengine\google\appengine\api\mail_stub.py", line 139, in _SendSMTP 
    smtp.quit() 
    File "C:\Python26\lib\smtplib.py", line 730, in quit 
    res = self.docmd("quit") 
    File "C:\Python26\lib\smtplib.py", line 362, in docmd 
    self.putcmd(cmd,args) 
    File "C:\Python26\lib\smtplib.py", line 318, in putcmd 
    self.send(str) 
    File "C:\Python26\lib\smtplib.py", line 310, in send 
    raise SMTPServerDisconnected('please run connect() first') 
SMTPServerDisconnected: please run connect() first** 

そのはSMTPServerDisconnectedは、接続()最初 次のコードを実行してください、私は

mail.send_mailを使用していますことを伝える(とデータの示すエラーを提出した後、私はその形で自分のアプリケーションを実行しています送信者= "[email protected]"、 へ= "[email protected]"、 対象= "テストメッセージ"、 ボディ= ""」 親愛なるアルバート:

  Your example.com account has been approved. You can now visit 
      http://www.example.com/ and sign in using your Google Account to 
      access new features. 

      Please let us know if you have any questions. 

      The example.com Team 
      """) 

私は、SMTPサーバーは、あなたが設定されている

答えて

0

を使用する?:http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail

を事前にいずれかの応答を 感謝を待っています私はPythonとGoogle Appsに新しいです、このコードで間違っているものを私に教えてください

SMTPホストはSMTPサーバー(つまり、あなたのメールリレー)完全修飾ドメイン名(電子メールアドレスではなく、ネットワーク上のサーバー名)。

+1

ここで言及したものと同じサンプルコード(http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail) 特に私は私の中にSMTPサーバーを設定していませんローカル、そのPythonからのパスを取る.. – SKSK

+0

Erは、その例のように 'smtp.example.com'を使用して明らかに動作するつもりはありません。あなたの正確なコマンドラインは何ですか? –

+0

HiJohnson ... smtp_hostメールIDの場合 'smtp.example.com'が指定されていないメールIDを指定しました。これは私のコマンドラインです dev_appserver.py [email protected] --smtp_port = 25 - smtp_user = aaaa --smtp_password = bbbb temp ここでtempは私のアプリケーションです どこからホスト、ポート、ユーザ名、パスワードの詳細を取得できますか? – SKSK