So I made a small app that sends emails from web2py, connected to the gmail smtp server. The problem here is that it always gives me a success message! Even when the email-id is invalid. I have tested the bounce back feature of gmail by sending mails from gmail to invalid email ids to which gmail says 'Your message has been sent', but on going to the sent folder gives the mailer daemon with a time lag(this differs for different mailing services). I think the mail.send() feature of web2py is unable to capture that and takes the 'Your message has been sent' as confirmation. How can one capture mails that haven't been sent using web2py?
if mail.send(session.email,subject=session.subject,message= session.message):
response.flash = 'email sent sucessfully.'
else:
response.flash = 'fail to send email sorry!'