Q:

Web2py Email Authentication

I Have set Web2py to send email verification on registration and not to allow log on until verified with the following settings:
mail=auth.settings.mailer 

mail.settings.server = 'smtp.gmail.com:587' 
mail.settings.sender = 'my_email_address@gmail.com' 
mail.settings.tls=True
mail.settings.login = 'my_email_address@gmail.com:my_gmail_password'

auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.login_after_registration = False

Email is being sent for password reset but not for registration. It also is allowing logon.
i am not sure why?  
Here is my register form code:
def register():

    form = SQLFORM(db.auth_user)
    form.element('table').insert(-1,(T('Please confirm that you are not a machine :'),Recaptcha(request, PUBLIC_KEY, PRIVATE_KEY, options="theme:'white'"),''))
    if form.process(onvalidation=lola).accepted:
        session.flash = 'record inserted'
        make_thumb(db.auth_user, form.vars.id,(250,250))
        redirect(URL('login'))
    return dict(form=form)

A:

If you want some of the extra registration features, such as email verification, you'll need to use the built-in auth.register() function:
def register():
    return dict(form=auth.register())

If you need to run callback functions on validation and on form acceptance, you can specify them using auth.settings.register_onvalidation and auth.settings.register_onaccept.

