From 3c379a9bf256e6ec66d737f21f8c9a9a11730cf1 Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Fri, 19 Sep 2025 18:11:31 +0530 Subject: [PATCH] version 1 --- mailling/mail-templates/charts.html | 157 +++++ mailling/mail-templates/dpr.html | 598 +++++++++++++++++ mailling/test mail sender/body.txt | 157 +++++ python-email-sender/body.txt | 599 ++++++++++++++++++ python-email-sender/config.json | 10 + .../mail-sender-with-charts.py | 84 +++ .../test-mail-sender-body-file.py | 35 + python-email-sender/test-mail-sender.py | 84 +++ 8 files changed, 1724 insertions(+) create mode 100644 mailling/mail-templates/charts.html create mode 100644 mailling/mail-templates/dpr.html create mode 100644 mailling/test mail sender/body.txt create mode 100644 python-email-sender/body.txt create mode 100644 python-email-sender/config.json create mode 100644 python-email-sender/mail-sender-with-charts.py create mode 100644 python-email-sender/test-mail-sender-body-file.py create mode 100644 python-email-sender/test-mail-sender.py diff --git a/mailling/mail-templates/charts.html b/mailling/mail-templates/charts.html new file mode 100644 index 0000000..5d035d0 --- /dev/null +++ b/mailling/mail-templates/charts.html @@ -0,0 +1,157 @@ + + + + + + CSS Donut Variants + + + +
+ +
+ 45% +
+ + +
+ 73% +
+ + +
+ 90% +
+ +
+
+
+
25%
+
+ +
+
50%
+
+ +
+
75%
+
+ +
+
90%
+
+
+ + + diff --git a/mailling/mail-templates/dpr.html b/mailling/mail-templates/dpr.html new file mode 100644 index 0000000..d94e57d --- /dev/null +++ b/mailling/mail-templates/dpr.html @@ -0,0 +1,598 @@ + + + + + + Daily Progress Report + + + + +
+ +
+

Daily Progress Report

+
+ Project: ANP ultimas wakad
+ Date: 17 September 2025 +
+
+ + +
+ * Project Status Reported - Generated at 18-Sep-2025 03:30:03 UTC +
+ + +
+
+

TODAY'S ATTENDANCE

+
+ + +
+ +
+ 20 / 30 +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+ +
+

DAILY TASKS COMPLETED

+
+ + +
+ +
+ 20 / 30 +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+
+

DAILY TASKS COMPLETED

+

20 / 30

+

Team member present

+
+
Completed
+
In Progress
+
Pending
+
+
+ +
+

PROJECT COMPLETION STATUS

+

20 / 30

+

Team member present

+
+
Completed
+
In Progress
+
Pending
+
+
+ +
+

Regularization Pending

+

28/32

+

Regularization Pending

+
+
Completed
+
In Progress
+
Pending
+
+
+ +
+ +
+

Checkout Pending

+
+ + +
+ + +
+ +
+ 73% +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+ + +
+
+

Team members present on the site

+
+
+
+
+
+

Activity Report Pending

+
+
+ + +
+ +
+ 73% +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+
+ +
+

Team Strength on Site

+
+ + + + + + + + + + + + + + + + + + + + + +
Site Engineer1
Weilder15
Helper2
Painter1
+
+
+ + +
+

Activities (Tasks) Performed 17-Sep-2025

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMEJOB ROLECHECK INCHECK OUT
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
+
+ + + +
+ You have received this email because it contains important information about your Marco PMS Account account. +
+
+ + + \ No newline at end of file diff --git a/mailling/test mail sender/body.txt b/mailling/test mail sender/body.txt new file mode 100644 index 0000000..5d035d0 --- /dev/null +++ b/mailling/test mail sender/body.txt @@ -0,0 +1,157 @@ + + + + + + CSS Donut Variants + + + +
+ +
+ 45% +
+ + +
+ 73% +
+ + +
+ 90% +
+ +
+
+
+
25%
+
+ +
+
50%
+
+ +
+
75%
+
+ +
+
90%
+
+
+ + + diff --git a/python-email-sender/body.txt b/python-email-sender/body.txt new file mode 100644 index 0000000..67787e4 --- /dev/null +++ b/python-email-sender/body.txt @@ -0,0 +1,599 @@ + + + + + + Daily Progress Report + + + + +
+ +
+

Daily Progress Report

+
+ Project: ANP ultimas wakad
+ Date: 17 September 2025 +
+
+ + +
+ * Project Status Reported - Generated at 18-Sep-2025 03:30:03 UTC +
+ + +
+
+

TODAY'S ATTENDANCE

+
+ + +
+ +
+ 20 / 30 +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+ +
+

DAILY TASKS COMPLETED

+
+ + +
+ +
+ 20 / 30 +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+
+

DAILY TASKS COMPLETED

+

20 / 30

+

Team member present

+ +
+
Completed
+
In Progress
+
Pending
+
+
+ +
+

PROJECT COMPLETION STATUS

+

20 / 30

+

Team member present

+
+
Completed
+
In Progress
+
Pending
+
+
+ +
+

Regularization Pending

+

28/32

+

Regularization Pending

+
+
Completed
+
In Progress
+
Pending
+
+
+ +
+ +
+

Checkout Pending

+
+ + +
+ + +
+ +
+ 73% +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+ + +
+
+

Team members present on the site

+
+
+
+
+
+

Activity Report Pending

+
+
+ + +
+ +
+ 73% +
+ +
+ + +
+
+ Completed +
+
+ In Progress +
+
+ Pending +
+ +
+ +
+
+
+

Team members present on the site

+
+
+
+
+ +
+

Team Strength on Site

+
+ + + + + + + + + + + + + + + + + + + + + +
Site Engineer1
Weilder15
Helper2
Painter1
+
+
+ + +
+

Activities (Tasks) Performed 17-Sep-2025

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMEJOB ROLECHECK INCHECK OUT
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
Siddharth BardeSite Engineer17-Sep-2025 11:47 AM-
+
+ + + +
+ You have received this email because it contains important information about your Marco PMS Account account. +
+
+ + + \ No newline at end of file diff --git a/python-email-sender/config.json b/python-email-sender/config.json new file mode 100644 index 0000000..b978fa3 --- /dev/null +++ b/python-email-sender/config.json @@ -0,0 +1,10 @@ +{ + "EMAIL_CONFIGURATION": { + "EMAIL_HOST": "mail.marcoaiot.com", + "EMAIL_PORT": 587, + "EMAIL_USER": "admin@marcoaiot.com", + "EMAIL_PASS": "xxx", + "EMAIL_SUBJECT": "Database backup process", + "EMAIL_RECEIVERS": "vikas@marcoaiot.com,umesh@marcoaiot.com" + } +} \ No newline at end of file diff --git a/python-email-sender/mail-sender-with-charts.py b/python-email-sender/mail-sender-with-charts.py new file mode 100644 index 0000000..b0c168b --- /dev/null +++ b/python-email-sender/mail-sender-with-charts.py @@ -0,0 +1,84 @@ +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart +from email.mime.image import MIMEImage +import os +import cairosvg + +def generate_donut_svg(percentage, color="#0d6efd", size=120, thickness=4): + """ + Generate an inline SVG donut chart. + """ + svg = f""" + + + + + + + {percentage}% + + """ + return svg + +# Sender and receiver +sender_email = "marcoioitsoft@gmail.com" +receiver_emails = ["vikasnale@gmail.com", "vikas@marcoaiot.com", "umeshvdesai@outlook.com"] +password = "qrtq wfuj hwpp fhqr" # Use Gmail App Password here + +# Read HTML body from file +file_path = os.path.join(os.path.dirname(__file__), "body.txt") +with open(file_path, "r", encoding="utf-8") as f: + body = f.read() + +# Create the email +message = MIMEMultipart("related") +message["From"] = sender_email +message["To"] = ", ".join(receiver_emails) +message["Subject"] = "Test HTML Email with Donut Charts" + +# Generate SVGs and convert to PNGs +donut_svgs = [ + generate_donut_svg(45, "#e63946"), + generate_donut_svg(73, "#0d6efd"), + generate_donut_svg(90, "#198754") +] + +# Attach donuts as inline images +for i, svg in enumerate(donut_svgs, start=1): + png_bytes = cairosvg.svg2png(bytestring=svg.encode("utf-8")) + img = MIMEImage(png_bytes, "png") + cid = f"donut{i}" + img.add_header("Content-ID", f"<{cid}>") + message.attach(img) + body += f'
Donut{i}' + +# Attach the final HTML body +message.attach(MIMEText(f"{body}", "html")) + +# Send the email +try: + server = smtplib.SMTP("smtp.gmail.com", 587) + server.starttls() + server.login(sender_email, password) + server.sendmail(sender_email, receiver_emails, message.as_string()) + print("✅ Email sent successfully with embedded donut PNGs!") +except Exception as e: + print("❌ Error:", e) +finally: + server.quit() diff --git a/python-email-sender/test-mail-sender-body-file.py b/python-email-sender/test-mail-sender-body-file.py new file mode 100644 index 0000000..2706a38 --- /dev/null +++ b/python-email-sender/test-mail-sender-body-file.py @@ -0,0 +1,35 @@ +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart +import os + +# Sender and receiver +sender_email = "marcoioitsoft@gmail.com" +receiver_emails = ["vikasnale@gmail.com", "vikas@marcoaiot.com"] +password = "qrtq wfuj hwpp fhqr" # Use Gmail App Password here + +# Read body from text file (e.g., body.txt in the same folder) +file_path = os.path.join(os.path.dirname(__file__), "body.txt") +with open(file_path, "r", encoding="utf-8") as f: + body = f.read() + +# Create the email +message = MIMEMultipart() +message["From"] = sender_email +message["To"] =", ".join(receiver_emails) +message["Subject"] = "Test Email from Python" + +# Attach body +message.attach(MIMEText(body, "html")) + +try: + # Connect to Gmail SMTP server + server = smtplib.SMTP("smtp.gmail.com", 587) + server.starttls() # Secure the connection + server.login(sender_email, password) + server.sendmail(sender_email, receiver_emails, message.as_string()) + print("✅ Email sent successfully!") +except Exception as e: + print("❌ Error:", e) +finally: + server.quit() diff --git a/python-email-sender/test-mail-sender.py b/python-email-sender/test-mail-sender.py new file mode 100644 index 0000000..b0c168b --- /dev/null +++ b/python-email-sender/test-mail-sender.py @@ -0,0 +1,84 @@ +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart +from email.mime.image import MIMEImage +import os +import cairosvg + +def generate_donut_svg(percentage, color="#0d6efd", size=120, thickness=4): + """ + Generate an inline SVG donut chart. + """ + svg = f""" + + + + + + + {percentage}% + + """ + return svg + +# Sender and receiver +sender_email = "marcoioitsoft@gmail.com" +receiver_emails = ["vikasnale@gmail.com", "vikas@marcoaiot.com", "umeshvdesai@outlook.com"] +password = "qrtq wfuj hwpp fhqr" # Use Gmail App Password here + +# Read HTML body from file +file_path = os.path.join(os.path.dirname(__file__), "body.txt") +with open(file_path, "r", encoding="utf-8") as f: + body = f.read() + +# Create the email +message = MIMEMultipart("related") +message["From"] = sender_email +message["To"] = ", ".join(receiver_emails) +message["Subject"] = "Test HTML Email with Donut Charts" + +# Generate SVGs and convert to PNGs +donut_svgs = [ + generate_donut_svg(45, "#e63946"), + generate_donut_svg(73, "#0d6efd"), + generate_donut_svg(90, "#198754") +] + +# Attach donuts as inline images +for i, svg in enumerate(donut_svgs, start=1): + png_bytes = cairosvg.svg2png(bytestring=svg.encode("utf-8")) + img = MIMEImage(png_bytes, "png") + cid = f"donut{i}" + img.add_header("Content-ID", f"<{cid}>") + message.attach(img) + body += f'
Donut{i}' + +# Attach the final HTML body +message.attach(MIMEText(f"{body}", "html")) + +# Send the email +try: + server = smtplib.SMTP("smtp.gmail.com", 587) + server.starttls() + server.login(sender_email, password) + server.sendmail(sender_email, receiver_emails, message.as_string()) + print("✅ Email sent successfully with embedded donut PNGs!") +except Exception as e: + print("❌ Error:", e) +finally: + server.quit()