mubashirhussaindev commited on
Commit
f02a3e0
·
verified ·
1 Parent(s): ed4c051

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -63,6 +63,9 @@ def send_email(to_email, subject, body):
63
 
64
  logging.info(f"Email sent to {to_email}")
65
  return True
 
 
 
66
  except Exception as e:
67
  logging.error(f"Email error: {e}")
68
  raise Exception(f"Failed to send email: {str(e)}")
 
63
 
64
  logging.info(f"Email sent to {to_email}")
65
  return True
66
+ except smtplib.SMTPAuthenticationError as auth_error:
67
+ logging.error(f"SMTP Authentication Error: {auth_error}")
68
+ raise Exception(f"Failed to send email: Invalid credentials or app-specific password required.")
69
  except Exception as e:
70
  logging.error(f"Email error: {e}")
71
  raise Exception(f"Failed to send email: {str(e)}")