diff --git a/backend/app/services/email_service.py b/backend/app/services/email_service.py index 435d8c4..b899036 100644 --- a/backend/app/services/email_service.py +++ b/backend/app/services/email_service.py @@ -24,6 +24,17 @@ class EmailService: Returns: True if email was sent successfully, False otherwise """ + # Validate Mailgun configuration + if not settings.MAILGUN_API_URL or not settings.MAILGUN_API_URL.startswith( + ("http://", "https://") + ): + print("Warning: MAILGUN_API_URL not configured or missing protocol") + return False + + if not settings.MAILGUN_API_KEY: + print("Warning: MAILGUN_API_KEY not configured") + return False + body = f"From: {user_name or 'Anonymous'}\nEmail: {user_email or 'Not provided'}\n\n{message}" async with httpx.AsyncClient() as client: