i have problems capturing exceptions with pyramid_mailer.
When i send a mail using a server with smtp authentication activated and 
that fail, python raise a SMTPAuthenticationError: (535, '#5.7.0 
Authentication failed') and i try to catch like that:

       try:
            mailer = Mailer(host='smtpserver',
                port=25,
                username='[email protected]',
                password='pass')    
        except:   
            return Response('error', content_type='text/plain', 
status_int=500)
or

       try:
            mailer.send(message)
        except:
            return Response('error', content_type='text/plain', 
status_int=500)

I try to use SMTPAuthenticationError, SMTPResponseException, SMTPException 
imported from smtplib in "except" but a automatic debug page from pyramid 
appear:
 
smtplib.SMTPAuthenticationError

SMTPAuthenticationError: (535, '#5.7.0 Authentication failed')


What i doing wrong???


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/zGBYENv2eC8J.
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/pylons-discuss?hl=en.

Reply via email to