Script to send email notification to 80 users on 1st of every month after 12 pm est

Hi All

I am new to Python. Herein, I need to Schedule Email Notification from Python at 1st business day of every month at 12 30 PM EST to around 80 users. The email notification should contain little content like “Dashboard have been refreshed with latest data, here is link” and also the Tableau report link which user can click and open.

Please suggest script on how to achieve this. I have Jupyter notebook installed locally, so pls suggest.

Appreciate your help !!

If you want someone to write code for you, this is a paid service (also not provided here; you should try an actual job posting site such as Fiverr). If you are “new to Python” then presumably your intent is to learn Python so that you can write your own code. (Otherwise, why should it matter that the program is written in Python?)

So, start by breaking the problem down into logical steps, and figure out where you are stuck. For example, do you know how to send an email from the Python code? Do you know how to create the text that you want the email to contain? (Have you thought about the rules, that will tell you exactly what that text is? You say that there should be a Tableau report link; do you know what link it should use? Will it always use the same link? If it needs to use a different link each time, what are the rules that will tell you that link?)

Even if you found someone willing to write code for you, you would still need to be able to provide answers for question like this - because the correct code depends on the answer to those questions, and right now, nobody else could possibly know what the answers are.

3 Likes

Hi,
Firstly I was not wanting anyone to write script for me but just to suggest a way or ideas to achieve this since its a discussion community. I have myself tried to write below code but after checking the parameters am getting authentication error and not able to run it. I have given the credentials correctly in place of smtp server and this is the error am getting currently:

Error sending email: (535, b’5.7.3 Authentication unsuccessful’)

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

try:
# SMTP configuration
smtp_server = “*****"
smtp_port = **
sender_email = “abc@xyz.com
receiver_email = “xyz.com
password = "

# Create a multipart message and set headers
message = MIMEMultipart()
message["From"] = sender_email
message["To"] = receiver_email
message["Subject"] = "Test email from Python"

# Add body to email
body = "This is a test email sent from Python."
message.attach(MIMEText(body, "plain"))

# Connect to the SMTP server with TLS encryption
with smtplib.SMTP(smtp_server, smtp_port) as server:
    server.starttls()  # Upgrade connection to secure
    server.login(sender_email, password)
    server.sendmail(sender_email, receiver_email, message.as_string())

print("Email sent successfully")

except Exception as e:
print(f"Error sending email: {e}");