- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2026 10:10 PM
Hi everyone,
I’m working with a Databricks notebook where I run a SQL query using spark.sql. The query returns a small result set (mainly counts or summary values).
Once the notebook finishes running, I need to automatically send the query result from the Databricks notebook to an email (Outlook).
I’m looking for the simplest and commonly used approach to do this directly from a Databricks notebook, just a clean and reliable solution.
Any guidance or best practices would be appreciated.
Thanks
- Labels:
-
Spark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2026 10:20 PM
Hi @faizan_111111,
I would suggest setting up an email destination around a SQL Alert which should give you the ability to see returned results in the QUERY_RESULT_TABLEvariable. See: https://docs.databricks.com/aws/en/sql/user/alerts/
If this doesn't fit your use case exactly you could look at various python libraries that are designed to send emails. e.g https://docs.python.org/3/library/smtplib.html