You need a background process and database queue of tasks for this to
work well.

On Feb 3, 8:50 pm, weheh <richard_gor...@verizon.net> wrote:
> I tried the mail.settings.server='localhost:25' but still no results.
>
> As for Russel's comment, ultimately I intend to loop on a db of
> possibly thousands of users. I intend to put some pause between user
> emails in order to not trip spam filters. Do you anticipate a problem
> from that configuration?
>
> As for the for loop in my test case, it's only looking to email to me,
> for the time being (hence the if not me: continue statement). Now, the
> message.html file is under /web2py/applications/myapp/views/admin/
> message.html. Is that the correct place to put it?
>
> On Feb 3, 10: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?- Hide quoted text -
>
> > - Show quoted text -
>
>

-- 
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.

Reply via email to