<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Databricks Workflow for Sharing Delta Table Data via Email (Text &amp;amp; Attachment) in Databricks Free Edition Help</title>
    <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156233#M783</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="3"&gt;You can follow below&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Python&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;Task&lt;/STRONG&gt;&amp;nbsp;-&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;You can use a&amp;nbsp;Python Task&amp;nbsp;within a Databricks Workflow. It's ideal if you require strict HTML format with high flexibility.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;Python script can query the Delta table and the full dataset can be written to a&amp;nbsp;Unity Catalog Volume&amp;nbsp;as CSV or Excel file. You can use&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;&lt;FONT size="3"&gt;smtplib&amp;nbsp;or others to send the email with the summary injected in the body of the email and the file is attached directly from the Volume.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
 
fromaddr = "EMAIL address of the sender"
toaddr = "EMAIL address of the receiver"
 
# instance of MIMEMultipart
msg = MIMEMultipart()

# storing the senders email address  
msg['From'] = fromaddr

# storing the receivers email address 
msg['To'] = toaddr

# storing the subject 
msg['Subject'] = "Subject of the Mail"

# string to store the body of the mail
body = "Body_of_the_mail"

# attach the body with the msg instance
msg.attach(MIMEText(body, 'plain'))

# open the file to be sent 
filename = "File_name_with_extension"
attachment = open("Path of the file", "rb")

# instance of MIMEBase and named as p
p = MIMEBase('application', 'octet-stream')

# To change the payload into encoded form
p.set_payload((attachment).read())

# encode into base64
encoders.encode_base64(p)
 
p.add_header('Content-Disposition', "attachment; filename= %s" % filename)

# attach the instance 'p' to instance 'msg'
msg.attach(p)

# creates SMTP session
s = smtplib.SMTP('smtp.gmail.com', 587)

# start TLS for security
s.starttls()

# Authentication
s.login(fromaddr, "Password_of_the_sender")

# Converts the Multipart msg into a string
text = msg.as_string()

# sending the mail
s.sendmail(fromaddr, toaddr, text)

# terminating the session
s.quit()&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Databricks Dashboard Subscriptions -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="3"&gt;Its preferred method using native&amp;nbsp;Dashboards that leverages built in scheduling to distribute reports without writing any code. You can a&lt;/FONT&gt;&lt;FONT size="3"&gt;dd specific users or&amp;nbsp;Notification Destinations&amp;nbsp;(email groups) to be notified automatically after workflow is run. &lt;/FONT&gt;&lt;FONT size="3"&gt;S&lt;SPAN&gt;ubscribers get a PDF snapshot and can optionally include tabular data from selected dashboard widgets as CSV, TSV, or Excel attachments.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 06 May 2026 09:25:22 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-05-06T09:25:22Z</dc:date>
    <item>
      <title>Databricks Workflow for Sharing Delta Table Data via Email (Text &amp; Attachment)</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156210#M780</link>
      <description>&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;We have data in a Delta table that needs to be shared via email as both inline text and an attachment using a Databricks workflow. Could you please assist with this? If possible, kindly share a sample code as well.&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 May 2026 05:31:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156210#M780</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-05-06T05:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Workflow for Sharing Delta Table Data via Email (Text &amp; Attachment)</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156212#M781</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;&amp;nbsp;Databricks jobs/workflows handle orchestration be only for &lt;STRONG&gt;status&lt;/STRONG&gt; &lt;STRONG&gt;alerts&lt;/STRONG&gt;(Success, Failure, Completion), Delta table data can't be send as content of the email, To send delta table as&amp;nbsp;&lt;SPAN&gt;an email you will need a workflow task that reads the table and build an email, saves the same data as a CSV/Excel file (for the attachment), and send it through external email service like SMTP, Microsoft graph etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 06:29:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156212#M781</guid>
      <dc:creator>anmolhhns</dc:creator>
      <dc:date>2026-05-06T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Workflow for Sharing Delta Table Data via Email (Text &amp; Attachment)</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156228#M782</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;,&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db" data-pm-slice="1 1 []"&gt;There isn’t a native feature to embed a Delta table directly into an email body.&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db" data-pm-slice="1 1 []"&gt;You can build custom code to read the Delta table, format part of it as HTML, and send it through your company’s email service if one is available. In practice, I’d recommend showing only a small preview in the email rather than trying to inline the full table, and then attaching a file only if that is truly required.&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db" data-pm-slice="1 1 []"&gt;That said, this approach can get complicated fairly quickly. It adds custom logic, ongoing maintenance overhead, and potentially compliance concerns if the table contains PII or other sensitive data.&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db"&gt;If there is a hard requirement to send a file, then yes, generating an attachment is possible. But as a best practice, I would usually recommend...&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db"&gt;AI/BI Dashboards for internal stakeholders, so they always have access to the latest data&lt;/LI&gt;
&lt;LI class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db"&gt;Delta Sharing for external consumers or downstream tools that need direct access to the data&lt;/LI&gt;
&lt;LI class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db"&gt;Email attachments only when someone explicitly needs an offline copy&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="wnfdntf _1ibi0s3e6 _1ibi0s3ce _1ibi0s3db"&gt;The main downside with attachments is that they go stale immediately, and large files can also hit email size limits or get blocked by mail systems. A live dashboard or shared table is usually a cleaner and more maintainable approach over time.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 08:36:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156228#M782</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-06T08:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Workflow for Sharing Delta Table Data via Email (Text &amp; Attachment)</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156233#M783</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="3"&gt;You can follow below&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Python&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;Task&lt;/STRONG&gt;&amp;nbsp;-&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;You can use a&amp;nbsp;Python Task&amp;nbsp;within a Databricks Workflow. It's ideal if you require strict HTML format with high flexibility.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;Python script can query the Delta table and the full dataset can be written to a&amp;nbsp;Unity Catalog Volume&amp;nbsp;as CSV or Excel file. You can use&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;&lt;FONT size="3"&gt;smtplib&amp;nbsp;or others to send the email with the summary injected in the body of the email and the file is attached directly from the Volume.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
 
fromaddr = "EMAIL address of the sender"
toaddr = "EMAIL address of the receiver"
 
# instance of MIMEMultipart
msg = MIMEMultipart()

# storing the senders email address  
msg['From'] = fromaddr

# storing the receivers email address 
msg['To'] = toaddr

# storing the subject 
msg['Subject'] = "Subject of the Mail"

# string to store the body of the mail
body = "Body_of_the_mail"

# attach the body with the msg instance
msg.attach(MIMEText(body, 'plain'))

# open the file to be sent 
filename = "File_name_with_extension"
attachment = open("Path of the file", "rb")

# instance of MIMEBase and named as p
p = MIMEBase('application', 'octet-stream')

# To change the payload into encoded form
p.set_payload((attachment).read())

# encode into base64
encoders.encode_base64(p)
 
p.add_header('Content-Disposition', "attachment; filename= %s" % filename)

# attach the instance 'p' to instance 'msg'
msg.attach(p)

# creates SMTP session
s = smtplib.SMTP('smtp.gmail.com', 587)

# start TLS for security
s.starttls()

# Authentication
s.login(fromaddr, "Password_of_the_sender")

# Converts the Multipart msg into a string
text = msg.as_string()

# sending the mail
s.sendmail(fromaddr, toaddr, text)

# terminating the session
s.quit()&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Databricks Dashboard Subscriptions -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="3"&gt;Its preferred method using native&amp;nbsp;Dashboards that leverages built in scheduling to distribute reports without writing any code. You can a&lt;/FONT&gt;&lt;FONT size="3"&gt;dd specific users or&amp;nbsp;Notification Destinations&amp;nbsp;(email groups) to be notified automatically after workflow is run. &lt;/FONT&gt;&lt;FONT size="3"&gt;S&lt;SPAN&gt;ubscribers get a PDF snapshot and can optionally include tabular data from selected dashboard widgets as CSV, TSV, or Excel attachments.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 06 May 2026 09:25:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156233#M783</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-05-06T09:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Workflow for Sharing Delta Table Data via Email (Text &amp; Attachment)</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156249#M784</link>
      <description>&lt;P&gt;thank you for quick response&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 13:05:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/databricks-workflow-for-sharing-delta-table-data-via-email-text/m-p/156249#M784</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-05-06T13:05:37Z</dc:date>
    </item>
  </channel>
</rss>

