Peter, This code looks good to me. I will adopt the same for now.
Larry On Jun 19, 12:37 am, pecos1046 <pecos1...@gmail.com> wrote: > Hi Larry: > > Looking at your suggestion, I made a code change in tools.py and mail > with gae works well. Here my patch - so far so good, I wonder when it > will backfire. > > elif self.settings.server == 'gae': > from google.appengine.api import mail > attachments = attachments and > [(a.my_filename,a.my_payload) for a in attachments] > > if attachments and html: > result = > mail.send_mail(sender=self.settings.sender, to=to, > subject=subject, body=text, > html=html, > attachments=attachments) > > elif html: > result = > mail.send_mail(sender=self.settings.sender, to=to, > subject=subject, body=text, > html=html) > > elif attachments: > result = > mail.send_mail(sender=self.settings.sender, to=to, > subject=subject, body=text, > attachments=attachments) > > else: > result = > mail.send_mail(sender=self.settings.sender, to=to, > subject=subject, body=text) > > Thanks again > > Peter > > On Jun 17, 5:16 am, Larry <ziz...@gmail.com> wrote: > > > > > I was also getting thiserroron my first go at sending mail using > > gae. > > > I looked at the code in gluon/tools.py for sending gae mail : > > > elif self.settings.server == 'gae': > > from google.appengine.api import mail > > attachments = attachments and [(a.my_filename,a.my_payload) for a > > in attachments] > > result = mail.send_mail(sender=self.settings.sender, to=to, > > subject=subject, body=text, html=html, > > attachments=attachments) > > > and retried after removing the attachments=attachments from the > > send_mail and it worked if I send both text and html versions of the > > message. > > > I assume gae does not like the attachments value being None. > > > Larry > > > On Jun 11, 9:25 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > if you use server='gae' you should use login=None > > > Not sure if this is the problem anyway. Do you get anyerror? > > > > On 11 Giu, 10:12, pecos1046 <pecos1...@gmail.com> wrote: > > > > > I use theemailverification option for new user registration. It > > > > works fine in test mode on the google-appengine sdk. However when I > > > > upload the application to Google and change the smtp server to "gae" > > > > it is unable to send the verificationemail. The GoogleGAElog show > > > > the following warning message: > > > > >Mail.send failure:May not set empty value for 'attachments' > > > > > Here are my settings: > > > > >mail=Mail( ) > > > >mail.settings.server='gae' # your SMTP server > > > >mail.settings.sender='....@gmail.com' > > > >mail.settings.tls = True > > > >mail.settings.login='....@gmail.com:password' > > > > auth.settings.mailer=mail > > > > > I appreciate any help and suggestions. > > > > > Peter