Hello
I am trying to send a welcome message to user as an email. To achieve this, 
I have followed all the steps as they are described in the official 
documentation. Additionally all the settings that I have adopted for the 
purported functionality, can be found in the trailing email thread. 
However, I am still receiving an Error Message -* WARNING:web2py:email not 
send.* Can anyone help me out here please? Any help would be greatly 
appreciated. 

Thanks
Sandeep
-----------------------------------------------
from: [email protected]
to: [email protected]
subject: welcome

welcome to web2py

---------------------------------------------
-


In My private/appconfig.ini
[smtp]
server = smtp.gmail.com:587
sender = [email protected]
login  = [email protected]:*********

# IN db.py
mail = auth.settings.mailer
mail.settings.server = 'logging' if request.is_local else 
myconf.take('smtp.server')
mail.settings.sender = myconf.take('smtp.sender')
mail.settings.login = myconf.take('smtp.login')
mail.settings.tls = myconf.take('smtp.tls') or False
mail.settings.ssl = myconf.take('smtp.ssl') or False

# -------------------------------------------------------------------------
# configure auth policy
# -------------------------------------------------------------------------
auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

# In my controller file
def form():
    form = SQLFORM.factory(
        
Field('Frist_Name',type='string',requires=IS_NOT_EMPTY(),label=T('Your 
First Name')),
        Field('Last_Name',type='string',requires=IS_NOT_EMPTY(), 
label=T('Your Last Name')),
        Field('email',type='string',requires=IS_EMAIL(), label=T('Your 
Email Address')),
        Field('password',type='password',requires = 
[IS_STRONG(),CRYPT(key='sha512:thisisthekey')],label=T('password')),
        
Field('confirm_password',type='password',requires=IS_EQUAL_TO(request.vars.password),label=T('confirm-password')),
        Field('Gender',type='string', requires=IS_IN_SET(['male','female 
']),label=T('Your Sex')))
    if form.process().accepted:
        if mail:
            if mail.send(to=['[email protected]'], subject='welcome', 
message='welcome to web2py'):
                    response.flash = T('mail sand successful')
            else :
                response.flash = T('mail not send')
        else :
            response.flase = T('unable o send mail')
    elif form.errors:
        response.flase = 'form error'
    return locals()

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to