SMTPServerDisconnected problem
My google email sending app (that ever get data from the screen). On the development server, I specify the smtp config (host, port, user, password) when starting the server. then i run my application in this form after i submitted data showing error like
**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**
after telling that SMTPServerDisconnected, first run connect () with the following code i am using
mail.send_mail (sender = " abc@xyz.com ", to = " def@xyz.com ", 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 wrong in this code. I am new to Python and Google Apps.
I am waiting for an answer Thanks in advance
a source to share
Which SMTP server is configured to use ?: http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail
The SMTP Host will be the SMTP server (i.e. your mail relay) FQDN (not an email address, but a server name on the network).
a source to share