I hope you liked this Python automation project. Here are the links to get started ⤵ 🌟 Source Code: github.com/Sven-Bo/automate-sending-emails-using-python 🌟 Google Sheets Document: pythonandvba.com/sheets-invoice-data 🌟 Deta documentation: : docs.deta.sh/docs/micros/ *Happy Coding!* 🚀
hi, my code does not run smoothly, even after copying and pasting the source codes directly, even after typing manually the code line after line. Please advise me on what to do
@@Lokihits Thanks for watching. Unfortunately, with that bit of information, I cannot help you. You might want to take some time to write down which line of code is causing the error; let me know if you have modified the code from the tutorial, explain in more depth what you did to troubleshoot the problem and provide some more context. Thanks!
I've never been to the comment section; I usually only read. But for the first time, someone encouraged me to join. This is an excellent video; I never thought someone could explain the concepts this well. Great job! Hoping for growth in this channel! 💯
Hi there! I've followed step-by-step, nonetheless, in Deta, when I run the micro, the following appears: Traceback (most recent call last): File "/opt/python/detalib/debugger.py", line 142, in wrap result = func(event, context) File "/var/task/_entry.py", line 12, in handler import main # noqa File "/var/task/main.py", line 2, in import pandas as pd ModuleNotFoundError: No module named 'pandas' I have made sure that I installed all the modules everywhere(cmd, pycharm and powersell) Please let me know, thank you in advance
Hard to tell from a distance. My closest guess is that you are getting this issue because you are trying to import a module of a library which is not installed in your virtual environment. If you have run 'pip install pandas' already, ensure to call your Python file from the same environment in which you installed the package. For example, in your IDE/text editor, you might have set a different Python environment for executing your script. Therefore, try to run your Python file also from the command prompt. If that does not work, try searching for the text of your error message on Google/StackOverflow. Happy Debugging!
@@CodingIsFun Hello, My code runs well in my computer, I checked the env variables as well and all paths are included. The only issue I have is when I try to run it on Deta . I am now trying to adapt it into a tkinter gui, but honestly, my python experience is basic. My main goal is to share this program with colleagues that wouldn't require to install python. I appreciate your video nonetheless, you inspire me to keep grinding!
You rock 👏👏👏👏 .. Thank you. Exactly what I needed in my organisation. Just got my SMTP settings last week. It's like you are living in my brain. Thank you very very much.
I don't know much about python just start data mining with pandas but want to automatically run my script at particular time and send mail with attachment i was searching for code ..and u shared this.. little bit difficult for me because of new in this..but will definitely try this..thanks... 👍
Nice video, could this be used to send out emails each day (Monday to Friday) for X amount of weeks to people? e.g. a person is on a 6 week course and you want to send them a daily email with exercises/training to do? Thanks
Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!
Thanks for watching. It is possible, but you would need to schedule your Python script to run locally on your machine instead of running it in the cloud.
hi everyone, im getting some troubles when replicating this procedure. When i run locally the program it works fine and sends emails (it it has to ). when i push it to deta space i get a SMTP Responce exception , so it is not able to send emails. is there maybe some problems with smtp authorizing the mail sending from the server? Thanks
Thanks for watching. Hard to tell from a distance. You might want to try reaching out to the experts at the deta discord server: discord.com/invite/K3gYNqHXUU Happy Debugging!
Thank you for this. I see DETA has changed a lot since. Did you switch to a different platform for this. I am running into a problem and get this:❗ Error: failed to create a project, developer mode needs to be enabled to build apps.. nowhere online can I find a solution. If you know it please let me know. Thanks.
Thanks for watching. Yes, I know. Deta has unfortunately changed a lot. Currently, I run all my Python scripts and APIs on PythonAnywhere. However, the FastAPI feature on PythonAnywhere is currently in Beta, and the web UI for managing FastAPI there is a bit limited for now. Cheers, Sven ✌️
@@CodingIsFun Thanks again for your trusted recommendation. I would have stuck with Deta (space) had there been some simple way or help forum. Will dive into your channel much more.
Hi. I am having some problem in deploying the app. I don't know how to set the environment variables and how to set the event scheduler ( I want to send emails every 15 minutes lets say). Can you please guide me on just the deployment part for the new data space?
Hi thanks for the tutorial is there any other free alternatives you could recommend for deta as it looks like you cant host python code there anymore as the site layout has completely changed.
How did you name the columns in spreadsheet? Mine is showing error raise ValueError( ValueError: Missing column provided to 'parse_dates': 'from_date, to_date'
Hello, Is it possible to have this action be triggered with a checkbox instead of a yes or no as your video brings out. I have a spreadsheet that utilizes check marks, and would love if can use this method for it. Thank you for this video. It was very informative
Thanks for watching the video and for asking your question! I think it's a good idea for you to try it out yourself and see what happens with the checkbox. My guess is that it will be converted to a Boolean value, but it's always helpful to test things out and see how they work in practice.
Thanks for watching. Unfortunately, with that bit of information, I cannot help you. You might want to take some time to write down which line of code is causing the error; let me know if you have modified the code from the tutorial, explain in more depth what you did to troubleshoot the problem and provide some more context. Thanks!
Thanks for watching. That depends on your email provider. For outlook check out the following link: support.microsoft.com/en-us/office/sending-limits-in-outlook-com-279ee200-594c-40f0-9ec8-bb6af7735c2e I hope it helps! Cheers, Sven ✌️
Thank you for the turorial! I did want to ask a question though. When I try to load my env vars to deta it returns me the name of the env var and says it has an improper name. I was wondering if you had an idea why that could be. Thank you for your time.
@@CodingIsFun No worries! It was a formatting error in the txt file. However I did want to ask, did you use a virtual environment when making this tutorial? I did and I think its causing me some complications when it comes to uploading it to deta
Hi Sven, Many thanks for your clear explanations, it's very helpful! I'm trying to do the same using my Gmail account. As you explained, i tried to turn On the less secur apps access on my google account but unfortunately, Google changed their policy regarding this option last May and now it's no more available... So my question is, do you know if there is any why to get around this? Is it possible to use additional Python code or specific libraries? Thanks again
Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!
@@CodingIsFun Hi Sven, Sorry to disturbe you again with my questions ^^ I have one more question for you, for which I would greatly appreciate your support. In addition to your code I built a function which write in the csv file the sending status (whether emails are sent or not). The function works well on my computer (for each email sent, the status is updated from "to be send" to "sent"). But when I deploy it using Deta, the emails are sent but I get the following: OSError: [Errno 30] Read-only filesystem: 'data_email.csv' ---> so the sending status is not added to my csv file "data_email.csv". Can you please let me know if you already faced this error ?? if so, how can i fix it? as the solutions found on internet are not woking for me... Thanks
Hello, I have my own. I think you need to activate a specific password for python, I do not remember how I did that, but you need to set a specific password for specific apps, I remember the password is generated automatically, you copy it and you use it for that moment on. So, in the Python script I use the X password that was given by gmail. But I log-in with my usual password.
@@CodingIsFun I am getting an error that outlook authentication is failed. May be due to some security reasons. Your video is almost 2 years old. can you confirm me if this is still working or not
While using outlook it's giving "smtpauthenticationerror: (535, b'5.7.139 authentication unsuccessful, account locked.)" error I've tried using app password too for the app but it's still throwing the same error.
i want to add attachment, i have watched many videos but i failed to add attachment, can you help me for adding attachment files from specific folder more than one files to add and send it with the attachment.
Thanks for watching. In the official Python documentation you can find examples on how to add attachments: docs.python.org/3/library/email.examples.html
Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you!
@@CodingIsFun Thanks for the quick reply! What I meant is that, every minute (if the conditions are met) the email will be sent over and over again. I would like the mail to be sent only when the conditions are met for the first time.
@@thetiagofromchile It's feasible with additional customization. Consider adding a column called "Sent Already," and mark it with "x" once an email has been sent. Before sending any emails, you can check the conditions in that column. If no "x" is present, proceed with sending the email.
Hi Sir, Very good evening to you, We want to ensure that, upon using up the allotted 30 GB of storage in the Gmail account, the oldest emails are automatically deleted on a daily basis from both inbox and sent items. If you will provide the process, I will always be thankful for your kind act.
Thanks for watching. It seems your question is not related to the video. For general Python questions, you may want to check out our discord community: pythonandvba.com/discord
Please Share code for automatic attachment download from the outlook of specific subject line store that data in folder and by using that data run another python script automatically...it will also helpful 😀👍
Yes, it is possible to automate Google Docs with Python using the Google Docs API. The Google Docs API allows you to create, edit, and retrieve documents and their contents, as well as manage document formatting, styles, and templates. To get started with the Google Docs API, you will need to set up a project in the Google Cloud Console and enable the Google Docs API for your project. Then, you will need to install the Google API Client Library for Python and authenticate your app with the Google Cloud Platform. Once you have set up your project and installed the necessary libraries, you can use the Google Docs API to perform various tasks, such as creating new documents, inserting text and images into documents, formatting text and paragraphs, and more.
Hey there, thanks for watching the video! I'm sorry I can't help you with your problem based on the information you provided. To give me a better idea of what's going on, it would be super helpful if you could write down which line of code is causing the error, let me know if you modified the code from the tutorial, and explain in more detail what you did to troubleshoot the problem. Don't forget to also give me some context about your setup and environment. If you're having trouble figuring things out, another option is to join our Discord server at pyhtonandvba.com/discord. You can ask your question there and maybe someone in the community can help out. Thanks for understanding.
Hi Thank for the video. I am getting the below error when running "main.py". Please assist Traceback (most recent call last): File "C:\Users\Kamran\main.py", line 3, in from deta import app ImportError: cannot import name 'app' from 'deta' (C:\Users\Kamran\AppData\Local\Programs\Python\Python39\lib\site-packages\deta\__init__.py) [Finished in 1.967s]
@@CodingIsFunah sorry sven 😆.. thankssss i confused because this migration has minim literation and tutorial.. the structure micros has very different between old and new 😆
I like it, please can u help me, i have a Excel file, and in this file i have a xml mapping i don't know u have already heard about it, i wanna do the opération of extrecting xml from Excel with python can u help me on it ♥️
Thank you for watching the video. Your questions are great, but finding the time to answer them is difficult. Kindly understand that I receive many requests for individual solutions or modifications. That said, you might want to join our Discord server ( pythonandvba.com/discord ) and post your question there. Thanks for your understanding. Happy Coding!
i dont understand the error in my code, can you help. Here is the Code: for _, row in df.iterrows(): if (present == row["reminder_date"].date()) and (row["name_insured"] != ""): send_email( subject=f'[SENON UPDATES] : {row["ref_number"]} {row["name_insured"]}', receiver_email=row["email"], due_date=row["due_date"].strftime("%d, %b %Y"), # example: 11, Aug 2022 name_insured=row["name_insured"], ref_number=row["ref_number"], next_report=row["next_report"], carbon_copy=row["cc"], test_email=row["bcc"], adj_name=row["name"], Remarks=row["remarks"] this it the error message. File "C:\Users\Kervin\Desktop\Project\main.py", line 25, in query_data_and_send_emails due_date=row["due_date"].strftime("%d, %b %Y"), # example: 11, Aug 2022 ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'strftime' Thanks for the help
Thanks for watching. The error means you're trying to use strftime on a string. You need to convert row["due_date"] to a datetime object first. Here's how: df['due_date'] = pd.to_datetime(df['due_date']) Happy Coding!
Thanks for watching. To check emails using Outlook SMTP and Python, you need to use the IMAP protocol instead of SMTP, as SMTP is for sending emails. You can use the built-in imaplib module. Happy Coding! :)
Hello, this is a great video. I was looking for something like this but I am getting this error in my code PS C:\Users\ABIR\Desktop\automatic_reminder> & C:/Users/ABIR/AppData/Local/Programs/Python/Python310/python.exe c:/Users/ABIR/Desktop/automatic_reminder/main.py Traceback (most recent call last): File "c:\Users\ABIR\Desktop\automatic_reminder\main.py", line 3, in from deta import app ImportError: cannot import name 'app' from 'deta' (C:\Users\ABIR\AppData\Local\Programs\Python\Python310\lib\site-packages\deta\__init__.py) PS C:\Users\ABIR\Desktop\automatic_reminder>
@@sadmansakibabir8456 I suggest creating a separate virtual environment and installing the required libraries there. This will ensure that you have a clean, isolated environment for running your Python code, which can help avoid conflicts with any other libraries that you have installed on your machine.
@@sadmansakibabir8456 I suggest creating a separate virtual environment and installing the required libraries there. This will ensure that you have a clean, isolated environment for running your Python code, which can help avoid conflicts with any other libraries that you have installed on your machine.
Thats what keeps popping up when i run the code. Traceback (most recent call last): File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in import smtplib ^^^^^^^^^^^^^^ File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in import email.utils File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in from email.message import EmailMessage ModuleNotFoundError: No module named 'email.message'; 'email' is not a package
also, this message, PS C:\Users\lenovo\Desktop\Automate emails> & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50360' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py' File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 16 else find_dotenv() ^^^^ SyntaxError: invalid syntax vo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-202vo\AppData\Local\Programs\Python\Py2.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50384' '--' 'c:\Users\lenovo\Desktop\Autpy\adapter/../..\debugpy\launcher' omate emails\email.py' File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in import smtplib ^^^^^^^^^^^^^^ File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in import email.utils File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in from email.message import EmailMessage ModuleNotFoundError: No module named 'email.message'; 'email' is not a package PS C:\Users\lenovo\Desktop\Automate emails> c:; cd 'c:\Users\lenovo\Desktop\Automate emails'; & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50669' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py' File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in import smtplib ^^^^^^^^^^^^^^ File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in import email.utils File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in from email.message import EmailMessage ModuleNotFoundError: No module named 'email.message'; 'email' is not a package PS C:\Users\lenovo\Desktop\Automate emails> c:; cd 'c:\Users\lenovo\Desktop\Automate emails'; & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50680' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py' Traceback (most recent call last): File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in import smtplib
Hi Sven, Thank you for the tutorial. My code was already running smoothly, however i am receiving this kind of Spam Error. Traceback (most recent call last): File "C:\Users\Kervin\Desktop\Project\HO\main.py", line 40, in result = query_data_and_send_emails(df) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kervin\Desktop\Project\HO\main.py", line 24, in query_data_and_send_emails send_email( File "C:\Users\Kervin\Desktop\Project\HO\send_email.py", line 79, in send_email server.sendmail(sender_email, recipient_list, msg.as_string()) File "C:\Users\Kervin\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 908, in sendmail raise SMTPDataError(code, resp) smtplib.SMTPDataError: (554, b'5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message [BeginDiagnosticData]WASCL UserAction verdict is not None. Actual verdict is RefuseQuota. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is RefuseQuota.[EndDiagnosticData] [Hostname=SL2P216MB2089.KORP216.PROD.OUTLOOK.COM]') [Finished in 977.0s] can you help me how to avoid being detected as spam? Thanks in advance
I ran the code and it gave me the below: C:\Users\tgulu\PycharmProjects\Cal1\venv\Scripts\python.exe C:\Users\tgulu\PycharmProjects\Cal1\send_email.py Traceback (most recent call last): File "C:\Users\tgulu\PycharmProjects\Cal1\send_email.py", line 66, in send_email( File "C:\Users\tgulu\PycharmProjects\Cal1\send_email.py", line 61, in send_email server.login(sender_email, password_email) File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 750, in login raise last_exception File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 739, in login (code, resp) = self.auth( File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 662, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful [JN2P275CA0019.ZAFP275.PROD.OUTLOOK.COM 2023-05-10T13:15:20.601Z 08DB503DF1E9D070]') Process finished with exit code 1 PS: I don't know anything about coding but I really need this to work.
I hope you liked this Python automation project.
Here are the links to get started ⤵
🌟 Source Code: github.com/Sven-Bo/automate-sending-emails-using-python
🌟 Google Sheets Document: pythonandvba.com/sheets-invoice-data
🌟 Deta documentation: : docs.deta.sh/docs/micros/
*Happy Coding!* 🚀
hi, my code does not run smoothly, even after copying and pasting the source codes directly, even after typing manually the code line after line. Please advise me on what to do
@@Lokihits Thanks for watching. Unfortunately, with that bit of information, I cannot help you. You might want to take some time to write down which line of code is causing the error; let me know if you have modified the code from the tutorial, explain in more depth what you did to troubleshoot the problem and provide some more context. Thanks!
Thanks for your reply. sure i could send a screenshot of the error that keeps popping up.
@@Lokihits You cannot attach screenshots to RUclips comment. Just write it down here
I've never been to the comment section; I usually only read. But for the first time, someone encouraged me to join. This is an excellent video; I never thought someone could explain the concepts this well. Great job! Hoping for growth in this channel! 💯
Thanks for the positive feedback and your kind words! Appreciate you taking the time to leave a comment. 👍
Excellent video! Thank you! I was looking for something like this and your explanation took me over the finish line.
Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video!
Hi there!
I've followed step-by-step, nonetheless, in Deta, when I run the micro, the following appears:
Traceback (most recent call last):
File "/opt/python/detalib/debugger.py", line 142, in wrap
result = func(event, context)
File "/var/task/_entry.py", line 12, in handler
import main # noqa
File "/var/task/main.py", line 2, in
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
I have made sure that I installed all the modules everywhere(cmd, pycharm and powersell)
Please let me know, thank you in advance
Hard to tell from a distance. My closest guess is that you are getting this issue because you are trying to import a module of a library which is not installed in your virtual environment. If you have run 'pip install pandas' already, ensure to call your Python file from the same environment in which you installed the package. For example, in your IDE/text editor, you might have set a different Python environment for executing your script. Therefore, try to run your Python file also from the command prompt. If that does not work, try searching for the text of your error message on Google/StackOverflow. Happy Debugging!
@@CodingIsFun Hello,
My code runs well in my computer, I checked the env variables as well and all paths are included. The only issue I have is when I try to run it on Deta
. I am now trying to adapt it into a tkinter gui, but honestly, my python experience is basic. My main goal is to share this program with colleagues that wouldn't require to install python. I appreciate your video nonetheless, you inspire me to keep grinding!
Great i was struggling with this problem for quite some time now. Thanks
Glad I could help! Thanks for watching! -Sven ✌️
@@CodingIsFun unfortunatly deta is shutting down, are there any free alternatives that I can use that you know of?
You rock 👏👏👏👏 .. Thank you. Exactly what I needed in my organisation. Just got my SMTP settings last week. It's like you are living in my brain. Thank you very very much.
Happy to hear that you found the video helpful. Happy Coding! 🚀
I don't know much about python just start data mining with pandas but want to automatically run my script at particular time and send mail with attachment i was searching for code ..and u shared this.. little bit difficult for me because of new in this..but will definitely try this..thanks... 👍
Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video! Happy Coding! :)
This is exactly what I’m looking for, thank you!
Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video! Cheers, Sven ✌️
As always you deliver gold, thank you!
Hi Ermal Gashi. Happy to see you around. Thanks for watching and your kind words! 👍
Nice video, could this be used to send out emails each day (Monday to Friday) for X amount of weeks to people? e.g. a person is on a 6 week course and you want to send them a daily email with exercises/training to do? Thanks
Thanks for watching. Yes, that sounds possible.
thank you, that was a great video and i learned a lot! just asking, is there a way to check if your email has been replied to using python? thanks
Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!
@@CodingIsFun thank you for the feedback!
Great video! Do you think it is possible to make the same tool, but for an offline excel sheet?
Thanks for watching. It is possible, but you would need to schedule your Python script to run locally on your machine instead of running it in the cloud.
hi everyone, im getting some troubles when replicating this procedure. When i run locally the program it works fine and sends emails (it it has to ). when i push it to deta space i get a SMTP Responce exception , so it is not able to send emails. is there maybe some problems with smtp authorizing the mail sending from the server? Thanks
Thanks for watching. Hard to tell from a distance. You might want to try reaching out to the experts at the deta discord server: discord.com/invite/K3gYNqHXUU
Happy Debugging!
@@CodingIsFun thank you always for your kind support, appreciate it!
Thanks for explanation and inspiration! Your videos are great!
Hi Jörn! Happy to hear that. Thanks for watching the video and taking the time to leave a comment! 👍
how do I deal with this error: raise SMTPResponseException(code, message)
smtplib.SMTPResponseException: (334, b'UGFzc3dvcmQ6')
Hard to tell from a distance. Sorry that I cannot help
Thank you for this. I see DETA has changed a lot since. Did you switch to a different platform for this. I am running into a problem and get this:❗ Error: failed to create a project, developer mode needs to be enabled to build apps.. nowhere online can I find a solution. If you know it please let me know. Thanks.
Thanks for watching. Yes, I know. Deta has unfortunately changed a lot. Currently, I run all my Python scripts and APIs on PythonAnywhere. However, the FastAPI feature on PythonAnywhere is currently in Beta, and the web UI for managing FastAPI there is a bit limited for now. Cheers, Sven ✌️
@@CodingIsFun Thanks again for your trusted recommendation. I would have stuck with Deta (space) had there been some simple way or help forum. Will dive into your channel much more.
Hi. I am having some problem in deploying the app. I don't know how to set the environment variables and how to set the event scheduler ( I want to send emails every 15 minutes lets say). Can you please guide me on just the deployment part for the new data space?
Hi thanks for the tutorial is there any other free alternatives you could recommend for deta as it looks like you cant host python code there anymore as the site layout has completely changed.
hm same problem here any solution u got?
How did you name the columns in spreadsheet? Mine is showing error raise ValueError(
ValueError: Missing column provided to 'parse_dates': 'from_date, to_date'
Thanks for watching. In the video I am explaining the spreadsheet structure.
I'm getting this error "SmtpClientAuthentication is disabled for the Tenant". Is there another way of sending emails without using smtplib?
Thanks for watching. You can also use an (paid) API Email service. Here is one example: github.com/sendgrid/sendgrid-python/#quick-start
@@CodingIsFun Thanks for the reply.
I used gmail account as sender and receiver email. My code is running perfectly but im not receiving any test emails. Can you help me?
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
Hello, Is it possible to have this action be triggered with a checkbox instead of a yes or no as your video brings out. I have a spreadsheet that utilizes check marks, and would love if can use this method for it. Thank you for this video. It was very informative
Thanks for watching the video and for asking your question! I think it's a good idea for you to try it out yourself and see what happens with the checkbox. My guess is that it will be converted to a Boolean value, but it's always helpful to test things out and see how they work in practice.
Im trying to add CC in my emails.
the Email address is reflected in the email however it is not receive by the person.
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
Thank you so much duuuuuuuude!!! i love your work
Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video!
@@CodingIsFun can this work with streamlit?
@@tebogoselepe969 in general, yes
My python script is not recognizing dotenv... What can I do to fix it?
Thanks for watching. Unfortunately, with that bit of information, I cannot help you. You might want to take some time to write down which line of code is causing the error; let me know if you have modified the code from the tutorial, explain in more depth what you did to troubleshoot the problem and provide some more context. Thanks!
What is the program on which you wrote the rotation of the device "python-dotenv pip install panads . please
Thanks for watching. That was my Windows Terminal
how to do this
@@OperationalComplianceCOOP Here you are: chat.openai.com/share/8d1ea8cc-7ad5-43f3-b207-daa2f2634250
this is awesome, thank you so much.
Glad you liked it. Thanks for watching and taking the time to leave a comment!
Hi sir how much is limit for the emails that can be sent daily thank you have a great day
Thanks for watching. That depends on your email provider. For outlook check out the following link:
support.microsoft.com/en-us/office/sending-limits-in-outlook-com-279ee200-594c-40f0-9ec8-bb6af7735c2e
I hope it helps! Cheers, Sven ✌️
How to access spreadsheet with my credentials as mentioned here??
As mentioned in the video, there are already a lot of tutorials here on RUclips on how to access private spreadsheets using Python.
Thank you for the turorial! I did want to ask a question though. When I try to load my env vars to deta it returns me the name of the env var and says it has an improper name. I was wondering if you had an idea why that could be. Thank you for your time.
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@@CodingIsFun No worries! It was a formatting error in the txt file. However I did want to ask, did you use a virtual environment when making this tutorial? I did and I think its causing me some complications when it comes to uploading it to deta
Hi Sven,
Many thanks for your clear explanations, it's very helpful!
I'm trying to do the same using my Gmail account. As you explained, i tried to turn On the less secur apps access on my google account but unfortunately,
Google changed their policy regarding this option last May and now it's no more available...
So my question is, do you know if there is any why to get around this?
Is it possible to use additional Python code or specific libraries?
Thanks again
Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!
@@CodingIsFun
Hi Sven,
Sorry to disturbe you again with my questions ^^
I have one more question for you, for which I would greatly appreciate your support.
In addition to your code I built a function which write in the csv file the sending status (whether emails are sent or not). The function works well on my computer (for each email sent, the status is updated from "to be send" to "sent").
But when I deploy it using Deta, the emails are sent but I get the following:
OSError: [Errno 30] Read-only filesystem: 'data_email.csv'
---> so the sending status is not added to my csv file "data_email.csv".
Can you please let me know if you already faced this error ??
if so, how can i fix it? as the solutions found on internet are not woking for me...
Thanks
Hello, I have my own. I think you need to activate a specific password for python, I do not remember how I did that, but you need to set a specific password for specific apps, I remember the password is generated automatically, you copy it and you use it for that moment on.
So, in the Python script I use the X password that was given by gmail. But I log-in with my usual password.
very useful! like python as well 😉🤗
Glad you liked it. Thanks for watching! 👍
hey, what if i have an own domain managed by google workspace?
Thanks for watching. I have explained it at the 3:03 mark. Good luck with your project! 🍀
Can I add CSS styling to the message, if yes how shall I do it?
Yes, you can apply inline style to the HTML element.
@@CodingIsFun I am getting an error that outlook authentication is failed. May be due to some security reasons. Your video is almost 2 years old. can you confirm me if this is still working or not
While using outlook it's giving "smtpauthenticationerror: (535, b'5.7.139 authentication unsuccessful, account locked.)" error I've tried using app password too for the app but it's still throwing the same error.
i want to add attachment, i have watched many videos but i failed to add attachment, can you help me for adding attachment files from specific folder more than one files to add and send it with the attachment.
Thanks for watching. In the official Python documentation you can find examples on how to add attachments: docs.python.org/3/library/email.examples.html
@@CodingIsFun thanks for your reply I will review
if i had include image in msg.add_alternative() how should i had
Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you!
can I use css in my html file to make my email file more slick?
Yes, you can. If that helps, consider supporting this channel by buying me a coffee here: "pythonandvba.com/coffee-donation"
I like it, Thank you brother.
An absolute pleasure, very happy to hear that you found it useful!
but the same reminder will be sent every minute... How can I set it to be sent only once?
If you want to run the script only once, there is no need to set up a cron job.
@@CodingIsFun Thanks for the quick reply! What I meant is that, every minute (if the conditions are met) the email will be sent over and over again. I would like the mail to be sent only when the conditions are met for the first time.
@@thetiagofromchile It's feasible with additional customization. Consider adding a column called "Sent Already," and mark it with "x" once an email has been sent. Before sending any emails, you can check the conditions in that column. If no "x" is present, proceed with sending the email.
@@CodingIsFun good idea thanks!
@@CodingIsFun one last question, how can I write into Google Sheets ?
Thanks!!!¨Helped me a lot!!!
Glad to hear that! :)
Hi Sir, Very good evening to you, We want to ensure that, upon using up the allotted 30 GB of storage in the Gmail account, the oldest emails are automatically deleted on a daily basis from both inbox and sent items. If you will provide the process, I will always be thankful for your kind act.
Thanks for watching. It seems your question is not related to the video. For general Python questions, you may want to check out our discord community: pythonandvba.com/discord
Please Share code for automatic attachment download from the outlook of specific subject line store that data in folder and by using that data run another python script automatically...it will also helpful 😀👍
Thanks for watching and your suggestion! 👍
This works with Google documents?
Yes, it is possible to automate Google Docs with Python using the Google Docs API. The Google Docs API allows you to create, edit, and retrieve documents and their contents, as well as manage document formatting, styles, and templates.
To get started with the Google Docs API, you will need to set up a project in the Google Cloud Console and enable the Google Docs API for your project. Then, you will need to install the Google API Client Library for Python and authenticate your app with the Google Cloud Platform.
Once you have set up your project and installed the necessary libraries, you can use the Google Docs API to perform various tasks, such as creating new documents, inserting text and images into documents, formatting text and paragraphs, and more.
@@CodingIsFun TY for this answer)
Sir, can I do the same in java ?
I am not an Java Expert, but I guess it is also possible in Java
@@CodingIsFun ok sir👍
Very impressive
Thank you, Florian!
(code, resp) = self.auth(
^^^^^^^^^^
authobject(challenge).encode('ascii'), eol='')
I keep running into this error, can someone help?
Hey there, thanks for watching the video! I'm sorry I can't help you with your problem based on the information you provided. To give me a better idea of what's going on, it would be super helpful if you could write down which line of code is causing the error, let me know if you modified the code from the tutorial, and explain in more detail what you did to troubleshoot the problem. Don't forget to also give me some context about your setup and environment.
If you're having trouble figuring things out, another option is to join our Discord server at pyhtonandvba.com/discord. You can ask your question there and maybe someone in the community can help out.
Thanks for understanding.
How can I embed an image an in email body?
Thanks for watching. Here is an example: stackoverflow.com/a/13071761
Happy Coding! Cheers, Sven ✌️
Does anyone know how to make this as an app or insert in a website?
🙋
@@CodingIsFun Can you do a tutorial sir?
Hello, nyc video and very detailed. But the mails are going into the spam of my test gmail id. Help Please!!!
Thanks for watching. Sorry, I cannot help with that.
@@CodingIsFun can you tell any possible reasons?
@@anubhavbairoliya1003 Nope, I would also need to search for a solution online
thank you brother
You're very welcome! Thank you for watching and for the comment!
Hi Thank for the video. I am getting the below error when running "main.py". Please assist
Traceback (most recent call last):
File "C:\Users\Kamran\main.py", line 3, in
from deta import app
ImportError: cannot import name 'app' from 'deta' (C:\Users\Kamran\AppData\Local\Programs\Python\Python39\lib\site-packages\deta\__init__.py)
[Finished in 1.967s]
As explained in the video (18:32 min), deta is a third-party package. If you want to install it, you need to run "pip install deta"
which ide you used
patrick can u create the tutorial for deta space? because deta will shuting down and migrate to deta space 😍
Thanks for watching! In the future, I might create an updated version to connect to deta space.
P.S. My name is Sven 😅
@@CodingIsFunah sorry sven 😆.. thankssss i confused because this migration has minim literation and tutorial.. the structure micros has very different between old and new 😆
can you please tell me how to run the code
Thanks for watching. I hope this helps: chat.openai.com/share/4e6c2278-f945-41aa-b0c7-35289c3c9ac7
thank youu @@CodingIsFun
I like it, please can u help me, i have a Excel file, and in this file i have a xml mapping i don't know u have already heard about it, i wanna do the opération of extrecting xml from Excel with python can u help me on it ♥️
Thank you for watching the video. Your questions are great, but finding the time to answer them is difficult. Kindly understand that I receive many requests for individual solutions or modifications. That said, you might want to join our Discord server ( pythonandvba.com/discord ) and post your question there. Thanks for your understanding. Happy Coding!
@@CodingIsFun thnk u so much for ur respense i'm gonna wait for the solution ♥️ wish you continuous success
i dont understand the error in my code, can you help.
Here is the Code:
for _, row in df.iterrows():
if (present == row["reminder_date"].date()) and (row["name_insured"] != ""):
send_email(
subject=f'[SENON UPDATES] : {row["ref_number"]} {row["name_insured"]}',
receiver_email=row["email"],
due_date=row["due_date"].strftime("%d, %b %Y"), # example: 11, Aug 2022
name_insured=row["name_insured"],
ref_number=row["ref_number"],
next_report=row["next_report"],
carbon_copy=row["cc"],
test_email=row["bcc"],
adj_name=row["name"],
Remarks=row["remarks"]
this it the error message.
File "C:\Users\Kervin\Desktop\Project\main.py", line 25, in query_data_and_send_emails
due_date=row["due_date"].strftime("%d, %b %Y"), # example: 11, Aug 2022
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'strftime'
Thanks for the help
Thanks for watching. The error means you're trying to use strftime on a string. You need to convert row["due_date"] to a datetime object first. Here's how: df['due_date'] = pd.to_datetime(df['due_date'])
Happy Coding!
Smart !
Glad you liked it. Thanks for watching.
Thank you! But i want add attack file.
And where are the files located?
from dotenv import load dotenv is not working
Thanks for watching. With that bit of information I cannot help you. Sorry!
deta new --python first_micro not working
Deta change their interface. Kindly refer to their docs
Can you please tell me where I can host this for scheduling except deta? Please send me any tutorial
@@BeingBlogger ruclips.net/video/UwvAMkH9tTU/видео.html&feature=shares
and if i want to attach some thing
...then you can also do that. Here are some examples: docs.python.org/3/library/email.examples.html
How to find the Port and if I use Gmail .. what would be the server ... How to find it
I suggest a quick Google search
Hello. Can you update the discord link please? I try to get in touch with you. Thank you! :)
Here is the link: pythonandvba.com/discord
now how to check your email using python.. :)
Thanks for watching. To check emails using Outlook SMTP and Python, you need to use the IMAP protocol instead of SMTP, as SMTP is for sending emails. You can use the built-in imaplib module. Happy Coding! :)
@@CodingIsFun ok, could you consider to make a video about it? ;-)
@@rb9888 I will keep in mind, but I cannot make any promises
Deta Cloud will be shutting down their services
Yepp, I know. Thanks for the hint. Feel free to use another service. -Sven
Hello,
this is a great video. I was looking for something like this but I am getting this error in my code
PS C:\Users\ABIR\Desktop\automatic_reminder> & C:/Users/ABIR/AppData/Local/Programs/Python/Python310/python.exe c:/Users/ABIR/Desktop/automatic_reminder/main.py
Traceback (most recent call last):
File "c:\Users\ABIR\Desktop\automatic_reminder\main.py", line 3, in
from deta import app
ImportError: cannot import name 'app' from 'deta' (C:\Users\ABIR\AppData\Local\Programs\Python\Python310\lib\site-packages\deta\__init__.py)
PS C:\Users\ABIR\Desktop\automatic_reminder>
Thanks for watching. As explained here: 18:34 min.
If you want to run it locally, ensure to run "pip install deta"
I have installed pip install deta but the problem is still prevailing
@@sadmansakibabir8456 I suggest creating a separate virtual environment and installing the required libraries there. This will ensure that you have a clean, isolated environment for running your Python code, which can help avoid conflicts with any other libraries that you have installed on your machine.
@@sadmansakibabir8456 I suggest creating a separate virtual environment and installing the required libraries there. This will ensure that you have a clean, isolated environment for running your Python code, which can help avoid conflicts with any other libraries that you have installed on your machine.
Thats what keeps popping up when i run the code.
Traceback (most recent call last):
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in
import smtplib
^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in
import email.utils
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in
from email.message import EmailMessage
ModuleNotFoundError: No module named 'email.message'; 'email' is not a package
rename email.py to send_email.py or something else and try again.
also, this message,
PS C:\Users\lenovo\Desktop\Automate emails> & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50360' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py'
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 16
else find_dotenv()
^^^^
SyntaxError: invalid syntax
vo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-202vo\AppData\Local\Programs\Python\Py2.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50384' '--' 'c:\Users\lenovo\Desktop\Autpy\adapter/../..\debugpy\launcher' omate emails\email.py'
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in
import smtplib
^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in
import email.utils
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in
from email.message import EmailMessage
ModuleNotFoundError: No module named 'email.message'; 'email' is not a package
PS C:\Users\lenovo\Desktop\Automate emails> c:; cd 'c:\Users\lenovo\Desktop\Automate emails'; & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50669' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py'
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in
import smtplib
^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 47, in
import email.utils
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 3, in
from email.message import EmailMessage
ModuleNotFoundError: No module named 'email.message'; 'email' is not a package
PS C:\Users\lenovo\Desktop\Automate emails> c:; cd 'c:\Users\lenovo\Desktop\Automate emails'; & 'C:\Users\lenovo\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '50680' '--' 'c:\Users\lenovo\Desktop\Automate emails\email.py'
Traceback (most recent call last):
File "c:\Users\lenovo\Desktop\Automate emails\email.py", line 2, in
import smtplib
@@Lokihits Just clone the repo and give it another try.
Why does your mouth movement and the voice seem off?
Thanks for watching. Probably because I did not sync my mic with my camera correctly.
Hi Sven,
Thank you for the tutorial.
My code was already running smoothly, however i am receiving this kind of Spam Error.
Traceback (most recent call last):
File "C:\Users\Kervin\Desktop\Project\HO\main.py", line 40, in
result = query_data_and_send_emails(df)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Kervin\Desktop\Project\HO\main.py", line 24, in query_data_and_send_emails
send_email(
File "C:\Users\Kervin\Desktop\Project\HO\send_email.py", line 79, in send_email
server.sendmail(sender_email, recipient_list, msg.as_string())
File "C:\Users\Kervin\AppData\Local\Programs\Python\Python311\Lib\smtplib.py", line 908, in sendmail
raise SMTPDataError(code, resp)
smtplib.SMTPDataError: (554, b'5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message [BeginDiagnosticData]WASCL UserAction verdict is not None. Actual verdict is RefuseQuota. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is RefuseQuota.[EndDiagnosticData] [Hostname=SL2P216MB2089.KORP216.PROD.OUTLOOK.COM]')
[Finished in 977.0s]
can you help me how to avoid being detected as spam?
Thanks in advance
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
I ran the code and it gave me the below:
C:\Users\tgulu\PycharmProjects\Cal1\venv\Scripts\python.exe C:\Users\tgulu\PycharmProjects\Cal1\send_email.py
Traceback (most recent call last):
File "C:\Users\tgulu\PycharmProjects\Cal1\send_email.py", line 66, in
send_email(
File "C:\Users\tgulu\PycharmProjects\Cal1\send_email.py", line 61, in send_email
server.login(sender_email, password_email)
File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 750, in login
raise last_exception
File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 739, in login
(code, resp) = self.auth(
File "C:\Users\tgulu\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 662, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful [JN2P275CA0019.ZAFP275.PROD.OUTLOOK.COM 2023-05-10T13:15:20.601Z 08DB503DF1E9D070]')
Process finished with exit code 1
PS: I don't know anything about coding but I really need this to work.
Thanks for watching. As shown in the video, you must set up the environment variables (using your email address + password). Happy Coding!
Where do I put the email and the password i have same problem@@CodingIsFun
@@OperationalComplianceCOOP please watch the video