Hi,
On 17 Jun., 11:38, "David Symonds" <
dsymo...@gmail.com> wrote:
> On Tue, Jun 17, 2008 at 7:31 PM, songokoussj2 <
SongokouS...@gmail.com> wrote:
> > The point is that gmail does not work for sending mails so there might
> > be a bug and i want to find out this bug or my mistake.
>
> It sounds like just a missing feature, not so much a "bug". You can
> always just file a bug ticket about it, though.
OK, I have the same problem and it's very strange.
The problem is this:
If you run
dev_appserver.py --smtp_host=
smtp.yourisp.com ... .
it works.
But if you run
dev_appserver.py --smtp_host=
smtp.gmail.com ... --smtp_port=587 .
it doesn't work.
Neither port 25 nor 587 work. The exception "SMTP AUTH extension not
supported by server" is raised. I've found out what the problem is:
dev_appserver.py doesn't support TLS, but GMail requires it. After I
inserted a little code snippet into api/mail_stub.py it can
successfully send mail via the GMail SMTP server:
After smtp.connect(self._smtp_host, self._smtp_port) I inserted:
smtp.ehlo()
smtp.starttls()
smtp.ehlo()
of course, it should actually check whether TLS should be used. :)
But there is another bug: dev_appserver.py is using the email API
incorrectly. In line 153 it says:
smtp.sendmail(mime_message['From'], tos, str(mime_message))
but it should be mime_message.as_string() because str(mime_message)
returns a format that looks more like mbox (beginning with the string
"From nobody Tue Jun ...") and thus isn't a valid email message. Some
servers still accepted it, but we always received a broken mail. Other
servers immediately rejected the mail. With the change to
mime_message.as_string() everything finally works as expected.
Bye,
Waldemar