Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Excel issue
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Scarface" data-source="post: 29914984" data-attributes="member: 150267"><p>To send reminder emails based on dates in an Excel file, you can use Python with libraries like pandas to read the Excel file and smtplib to send emails. Here's a step-by-step guide to accomplish this:</p><p></p><ol> <li data-xf-list-type="ol">Install required libraries:</li> </ol><p></p><p>Copy</p><p>pip install pandas openpyxl</p><p></p><ol> <li data-xf-list-type="ol">Create a Python script:</li> </ol><p>python</p><p>Copy</p><p>import pandas as pd</p><p>import smtplib</p><p>from email.mime.text import MIMEText</p><p>from email.mime.multipart import MIMEMultipart</p><p>from datetime import datetime, timedelta</p><p></p><p># Function to send email</p><p>def send_email(to_email, subject, body):</p><p> # Email configuration</p><p> from_email = "<a href="mailto:your_email@example.com">your_email@example.com</a>"</p><p> password = "your_email_password"</p><p> smtp_server = "smtp.example.com"</p><p> smtp_port = 587</p><p></p><p> # Create message</p><p> msg = MIMEMultipart()</p><p> msg['From'] = from_email</p><p> msg['To'] = to_email</p><p> msg['Subject'] = subject</p><p> msg.attach(MIMEText(body, 'plain'))</p><p></p><p> # Send email</p><p> with smtplib.SMTP(smtp_server, smtp_port) as server:</p><p> server.starttls()</p><p> server.login(from_email, password)</p><p> server.send_message(msg)</p><p></p><p># Read Excel file</p><p>df = pd.read_excel('your_excel_file.xlsx')</p><p></p><p># Get today's date</p><p>today = datetime.now().date()</p><p></p><p># Iterate through rows</p><p>for index, row in df.iterrows():</p><p> reminder_date = row['ReminderDate'].date()</p><p> email = row['Email']</p><p> message = row['Message']</p><p></p><p> # Check if reminder date is today</p><p> if reminder_date == today:</p><p> subject = "Reminder"</p><p> body = f"Hello,\n\nThis is a reminder: {message}\n\nBest regards,\nYour Reminder System"</p><p> send_email(email, subject, body)</p><p> print(f"Reminder sent to {email}")</p><p></p><p>print("Reminder process completed.")</p><p></p><ol> <li data-xf-list-type="ol">Customize the script:<ul> <li data-xf-list-type="ul">Replace 'your_excel_file.xlsx' with the path to your Excel file.</li> <li data-xf-list-type="ul">Update the email configuration in the send_email function with your email details.</li> <li data-xf-list-type="ul">Adjust the column names ('ReminderDate', 'Email', 'Message') to match your Excel file structure.</li> </ul></li> <li data-xf-list-type="ol">Prepare your Excel file: Ensure your Excel file has at least these columns:<ul> <li data-xf-list-type="ul">ReminderDate: The date for sending the reminder</li> <li data-xf-list-type="ul">Email: The recipient's email address</li> <li data-xf-list-type="ul">Message: The reminder message</li> </ul></li> <li data-xf-list-type="ol">Run the script: Execute the Python script. It will:<ul> <li data-xf-list-type="ul">Read the Excel file</li> <li data-xf-list-type="ul">Check for reminders due today</li> <li data-xf-list-type="ul">Send emails for matching reminders</li> </ul></li> <li data-xf-list-type="ol">Automate the script: To run this automatically every day:<ul> <li data-xf-list-type="ul">On Windows: Use Task Scheduler</li> <li data-xf-list-type="ul">On macOS or Linux: Use cron jobs</li> </ul></li> </ol><p>Remember to handle your email credentials securely. Consider using environment variables or a secure configuration file instead of hardcoding them in the script.</p><p></p><p>Also, be aware of your email provider's sending limits to avoid being flagged as spam.</p><p></p><p>Would you like me to explain any part of this process in more detail?</p></blockquote><p></p>
[QUOTE="Scarface, post: 29914984, member: 150267"] To send reminder emails based on dates in an Excel file, you can use Python with libraries like pandas to read the Excel file and smtplib to send emails. Here's a step-by-step guide to accomplish this: [LIST=1] [*]Install required libraries: [/LIST] Copy pip install pandas openpyxl [LIST=1] [*]Create a Python script: [/LIST] python Copy import pandas as pd import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime, timedelta # Function to send email def send_email(to_email, subject, body): # Email configuration from_email = "[email]your_email@example.com[/email]" password = "your_email_password" smtp_server = "smtp.example.com" smtp_port = 587 # Create message msg = MIMEMultipart() msg['From'] = from_email msg['To'] = to_email msg['Subject'] = subject msg.attach(MIMEText(body, 'plain')) # Send email with smtplib.SMTP(smtp_server, smtp_port) as server: server.starttls() server.login(from_email, password) server.send_message(msg) # Read Excel file df = pd.read_excel('your_excel_file.xlsx') # Get today's date today = datetime.now().date() # Iterate through rows for index, row in df.iterrows(): reminder_date = row['ReminderDate'].date() email = row['Email'] message = row['Message'] # Check if reminder date is today if reminder_date == today: subject = "Reminder" body = f"Hello,\n\nThis is a reminder: {message}\n\nBest regards,\nYour Reminder System" send_email(email, subject, body) print(f"Reminder sent to {email}") print("Reminder process completed.") [LIST=1] [*]Customize the script: [LIST] [*]Replace 'your_excel_file.xlsx' with the path to your Excel file. [*]Update the email configuration in the send_email function with your email details. [*]Adjust the column names ('ReminderDate', 'Email', 'Message') to match your Excel file structure. [/LIST] [*]Prepare your Excel file: Ensure your Excel file has at least these columns: [LIST] [*]ReminderDate: The date for sending the reminder [*]Email: The recipient's email address [*]Message: The reminder message [/LIST] [*]Run the script: Execute the Python script. It will: [LIST] [*]Read the Excel file [*]Check for reminders due today [*]Send emails for matching reminders [/LIST] [*]Automate the script: To run this automatically every day: [LIST] [*]On Windows: Use Task Scheduler [*]On macOS or Linux: Use cron jobs [/LIST] [/LIST] Remember to handle your email credentials securely. Consider using environment variables or a secure configuration file instead of hardcoding them in the script. Also, be aware of your email provider's sending limits to avoid being flagged as spam. Would you like me to explain any part of this process in more detail? [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom