My Google app engine application needs to send out email(what ever we get the data from screen). On development server i specify my smtp configuration (host,port,user,password) while starting the server. then I am running my application in that form after I submitted the data its showing error as
**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**
its telling that SMTPServerDisconnected, please run connect() first following code I am using
mail.send_mail(sender="[email protected]", to="[email protected]", subject="Test Message", body=""" Dear Albert:
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
""")
please tell me what is the wrong in this code i am new to Python and Google Apps
I am waiting for any one reply Thanks in advance