how is your mail config?

from gluon.tools import Mail
mail = Mail()
mail.settings.sender = ?
                      .server = ?

did you configured the login? is it ok?

use a try block to check which error you get.

try:
    mail.send(....)
except Exception, e:
   print str(e)
Em 23/08/2012 01:18, "SeamusSeamus" <[email protected]> escreveu:

> 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