If this is using the SDK, it does not send messages by default - you
even need to add an argument to appcfg.py to show the message body in
the logs.

If it is on production, then make sure you have supp...@example.com
set up as an admin user. If you read the docs for the mail API, it
tells you you must use an admin user's email address as the sender
address.

Cheers!
Greg.

On May 22, 9:57 pm, S K <sksk...@gmail.com> wrote:
> Hi Johnson
>                     as per ur guidance I have followed following format
> after that its is showing  Status:200 OK, but i am not able to seen the mail
> in what *TO *address I given, can any one tell me what could be the reason
>
> from google.appengine.api import mail
>
> mail.send_mail(sender="supp...@example.com",
>               to="Albert Johnson <albert.john...@example.com>",
>               subject="Your account has been approved",
>               body="""
> Dear Albert:
>
> Your example.com account has been approved.  You can now 
> visithttp://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
> """)
>
> Thanks In Advance
>
> On Fri, May 22, 2009 at 3:04 PM, Nick Johnson (Google) <
>
> nick.john...@google.com> wrote:
>
> > Hi S K,
>
> > You cannot use smtplib to send email in App Engine. You need to use
> > the Mail API instead:
> >http://code.google.com/appengine/docs/python/mail/
>
> > -Nick Johnson
>
> > On Fri, May 22, 2009 at 9:56 AM, S K <sksk...@gmail.com> wrote:
> > > Hi All,
>
> > > import smtplib
>
> > >  mail="a...@xyz.com";
> > >     subject="Hai";
> > >     msg = 'Some Text';
>
> > >     smtp_server = smtplib.SMTP( 'mail.%s' % mail.split( '@' )[-1] )
> > >     smtp_server.sendmail(
> > >           mail
> > >         , [ mail ]
> > >         , 'Subject: %s\n' % subject
> > >             + 'To: %s\n' % mail
> > >             + '\n'
> > >             + msg
> > >         )
>
> > > I am using above  code to send an Email, for this i am not installed any
> > > SMTP setup my local , I just given import smtplib
> > > and I am getting following error
>
> > > showing error at
> > >  smtp_server = smtplib.SMTP( 'mail.%s' % mail.split( '@' )[-1] ) this
> > line
>
> > > can any one tell that how to give STMP server setup in my local and run
> > > successfully the above code.
>
> > > 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
> > 129,
> > > in post
> > >     smtp_server = smtplib.SMTP( 'mail.%s' % mail.split( '@' )[-1] )
> > >   File "C:\Python26\lib\smtplib.py", line 239, in __init__
>
> > >     (code, msg) = self.connect(host, port)
> > >   File "C:\Python26\lib\smtplib.py", line 295, in connect
> > >     self.sock = self._get_socket(host, port, self.timeout)
> > >   File "C:\Python26\lib\smtplib.py", line 273, in _get_socket
>
> > >     return socket.create_connection((port, host), timeout)
> > > AttributeError: 'module' object has no attribute 'create_connection'
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to