This line
mail.send(to=['[email protected]'], subject=form.vars.onderwerp,
message=form.vars)
should never have worked as far as I can tell. form.vars is a Storage
object, not a string, as a message should be.
On Dec 26, 9:24 am, annet <[email protected]> wrote:
> After upgrading from 1.72.3 to 1.74.4 sending mail from my application
> no longer works. I get the following error ticket:
>
> Traceback (most recent call last):
> File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py",
> line 173, in restricted
> exec ccode in environment
> File "/Library/Python/2.5/site-packages/web2py/applications/init/
> controllers/utility.py", line 72, in <module>
> File "/Library/Python/2.5/site-packages/web2py/gluon/globals.py",
> line 96, in <lambda>
> self._caller = lambda f: f()
> File "/Library/Python/2.5/site-packages/web2py/applications/init/
> controllers/utility.py", line 64, in contact
> mail.send(to=['[email protected]'], subject=form.vars.onderwerp,
> message=form.vars)
> File "/Library/Python/2.5/site-packages/web2py/gluon/tools.py", line
> 282, in send
> text = text.read().decode(encoding).encode('utf-8')
> TypeError: 'NoneType' object is not callable
>
> The function reads like:
>
> def contact():
> form=SQLFORM.factory(SQLField('bedrijfsnaam'),
> SQLField(...),
> SQLField('onderwerp',label='Onderwerp *',requires=IS_NOT_EMPTY()),
> SQLField('bericht',type='text',label='Uw bericht
> *',requires=IS_NOT_EMPTY()))
> form[0][-1][1].append(INPUT(_type='reset',_value='Reset'))
> form[0][-1][1].append(INPUT
> (_type='button',_value='Cancel',_onclick='javascript:history.go(-1)'))
> if form.accepts(request.vars,session):
> response.flash='Het formulier is verzonden, u ontvangt binnen
> 5 werkdagen een reactie'
> mail.send(to=['[email protected]'], subject=form.vars.onderwerp,
> message=form.vars)
> form=[]
> elif form.errors:
> response.flash=response.flash_error
> else:
> response.flash='de velden gemerkt met een * zijn verplichte
> velden'
> return dict(form=form)
>
> Since it did work in version 1.72.3 I guess this has something to do
> with differences between versions.
>
> Kind regards,
>
> Annet
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.