My login settings such as auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True
are not working Any idea why? On Monday, January 21, 2013 2:26:31 PM UTC+1, rochacbruno wrote: > > > > in your models. > > mail = auth.settings.mailer > mail.settings.server = "your_smtp_server_and:port" > mail.settings.sender = "y...@you.com <javascript:>" > mail.settings.login = "y...@you.com:password" > > # sends an verification e-mail upon registration > auth.settings.registration_requires_verification = True > > > def send_email(user, subject): > message = """ Multi line string for %(first_name)s......" > message = open("somefile.html", "r").read() > # you also have the option to include everyone in bcc=[...] > mail.send(to=user.email, > subject=subject, > message=message % user) > > > Now in any place like controllers or scripts > > users = db(db.auth_user).select() > for user in users: > send_email(user, "some subject") > > > Dont forget to keep track of sent emails, use try: except... try to not > use gmail for more than 500 recipients. > > > > > If you want an email to be send everytime a user login in your page > > auth.settings.login_onaccept = lambda form: mail.send(to=form.vars.email, > subject="%(first_name)s logged in" % form.vars, message="User logged in %s" > % str(form.vars)) > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.