If details.email_address is a var, then it shouldn't be in quotes. To
avoid any doubt, just use a str: '[email protected]'
General approach: "first get it working, then improve it". Maybe this
will help...
def contact_us():
details=db.hotel_profile(request.args(0, cast=int))
form = SQLFORM.factory(
Field('name', requires=IS_NOT_EMPTY()),
Field('cell_number', requires=IS_NOT_EMPTY()),
Field('email', requires =[ IS_EMAIL(error_message='invalid email!'),
IS_NOT_EMPTY() ]),
Field('subject', requires=IS_NOT_EMPTY()),
Field('message', requires=IS_NOT_EMPTY(), type='text')
)
if form.process().accepted:
if mail.send(to = '[email protected]',
subject = 'Simple Subject',
message = 'My test message!'):
response.flash = T('Thank you, your form was submitted')
else:
response.flash = 'Error sending message!!!'
return dict(form=form)
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/4b8056f1-ed8f-4d19-ab04-edad73625e4e%40googlegroups.com.