Hi,
 I am trying to make a simple contact form that emails me the arguments. 
The email is not sending, and as soon as the page loads, my message 'Unable 
to send email' shows up as an error. 

In Controller:

def contactform():

    form=SQLFORM.factory(
        Field('your_email',requires=IS_EMAIL()),
        Field('question',requires=IS_NOT_EMPTY()))
    if form.process().accepted:
        if mail.send(to='[email protected]',
        subject='From %s' % form.vars.your_email,
        message=form.vars.question):
            redirect(URL('confirmation'))
    else:
        form.errors.your_email='Unable to send email'
        
    return dict(form=form)


In contactform.load
{{=form}}

In Contact me page:
{{=LOAD('contactform.load',ajax=True)}}



-- 



Reply via email to