There is a timeout on the thread that may affect it. On Feb 3, 3:27 pm, Russell <russell.mcmur...@gmail.com> wrote: > Just curious...The code shows the mail.send routine in a loop and the > whole thing could take some time to run. Should there be some limit > to the number of records that can be thrown into such a loop? About > how many records before this sort of thing should be handed off to a > daemon? > > On Feb 4, 4:36 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Can you try? > > > mail.settings.server='localhost:25' > > > On Feb 3, 12:02 am, weheh <richard_gor...@verizon.net> wrote: > > > > I'm trying to get the email module to work. In my model I say: > > > > #model > > > mail.settings.server='localhost' # your SMTP server > > > mail.settings.login=None # your credentials > > > mail.settings.sender='no-re...@foobar.com' # your email > > > > #controller "admin.py" > > > def email_blast(): > > > """Controller for sending email blasts to filtered user lists""" > > > # set up crud > > > crud.settings.create_onaccept=lambda form: send_email(form) > > > crud.settings.update_onaccept=lambda form: None > > > # build crud form > > > form = crud.update(db.email_blast,request.args(2),message=T('Blast > > > sent')) > > > # build record table > > > rows=crud.select(db.email_blast) > > > return dict(form=form,rows=rows) > > > > def send_email(form): > > > """Function sends email to all users that match query""" > > > for user in db(db.auth_user.id>0).select(): > > > if not user.email=='testa...@foobar.com': continue > > > context=dict(user=user) > > > #if form.vars.approved: > > > message = response.render('admin/message.html',context) > > > mail.send(to= > > > [user.email],subject=form.vars.subject,message=message) > > > > Mine is the test email address (real address in actual code). But I'm > > > never getting any email. > > > > My server is up and running OK and an old email program that I also > > > wrote that uses localhost is working fine. > > > > Any ideas where I'm going wrong? > >
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.