# Error Sending mail via SMTP inside space

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-sending-mail-via-smtp-inside-space%2F162245%3E%5C
**Category:** Spaces\
**Created:** [July 8, 2025, 4:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-sending-mail-via-smtp-inside-space%2F162245 "2025-07-08T16:29:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moosaafzal](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Moosaafzal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMoosaafzal)%5C
**Post date:** [July 8, 2025, 4:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-sending-mail-via-smtp-inside-space%2F162245%2F1 "2025-07-08T16:29:41Z")

</div>

Hello!

I’m trying to send an email via SMTP (using `smtp.gmail.com`) from within a **Space** , but I keep getting the following error:

“”"  
Exception raised: Timed out connecting to [smtp.gmail.com](http://smtp.gmail.com) on port 465. Check your credentials or email service configuration.  
“”"

I’ve tried all the common ports (465, 587, and 25), but the result is always the same. I’m sure my credentials are correct.

Has anyone successfully sent emails via SMTP from a Space? Any configuration or workaround that worked for you?

Thanks in advance!
