I am having a tough time to connect to smtp server from databricks with ACL enabled cluster , I am able to access with out ACL enabled cluster what can be done to access it via ACL enabled cluster
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Configuring SMTP server settings
smtp_server = "xxxx"
port = 25 # For starttls
sender_email = "xxxx"
receiver_email = "xxxx"
#password = dbutils.secrets.get(scope="your_scope", key="smtp_password")
# Creating the email message
message = MIMEMultipart()
message["From"] = sender_email
message["To"] = receiver_email
message["Subject"] = "Test email from DataBricks"
body = "This is a test email sent from a DataBricks notebook."
message.attach(MIMEText(body, "plain"))
# Sending the email
server = smtplib.SMTP(smtp_server, port)
server.starttls()
#server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, message.as_string())
server.quit()