Linux serverNETWORK ADMINISTRATIONSsmtp server liux

Automate Emails Using Python! Build An Automatic Payment Reminder & Schedule Your Scripts Online

Are you still manually sending emails to your customers and clients? In this video, I’ll show you how to send automated reminders. In particular, I will show you how to send emails with Python. Afterwards, we are going to host our Python script. You can then determine when exactly you want to run your script. This solution might be helpful if you do not want to spend a dime on any expensive email automation solution. You can build your email automation solution for free if you follow this video.

🌎 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦:
Source Code: https://github.com/Sven-Bo/automate-sending-emails-using-python
Google Sheets Document: https://pythonandvba.com/sheets-invoice-data
Deta documentation: https://docs.deta.sh/docs/micros/

⭐ 𝗧𝗜𝗠𝗘𝗦𝗧𝗔𝗠𝗣𝗦:
00:00 – Intro
00:56 – Project preparation
02:31 – Sending emails
07:52 – Accessing & querying Google Sheets data
12:44 – Testing the local Python solution
14:03 – Deployment to the cloud
19:30 – Testing the cloud solution
21:00 – Outro

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
𝗖𝗢𝗡𝗡𝗘𝗖𝗧 𝗪𝗜𝗧𝗛 𝗠𝗘:
🌎 Website: https://pythonandvba.com
📝 GitHub: https://github.com/Sven-Bo
⭐ Discord: https://pythonandvba.com/discord
▶️ Subscribe: https://youtube.com/c/CodingIsFun?sub_confirmation=1

🎉 𝗙𝗥𝗘𝗘 𝗘𝘅𝗰𝗲𝗹 𝗔𝗱𝗱-𝗶𝗻 𝘁𝗼 𝗯𝗼𝗼𝘀𝘁 𝘆𝗼𝘂𝗿 𝗽𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝘃𝗶𝘁𝘆
Get it here: https://pythonandvba.com/mytoolbelt

📚 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗳𝗼𝗿 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗩𝗕𝗔 & 𝗣𝘆𝘁𝗵𝗼𝗻
Check out my recommendations: https://pythonandvba.com/resources

☕ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲❓
If you want to support this channel, you can buy me a coffee here:
https://pythonandvba.com/coffee-donation

source

by Coding Is Fun

linux smtp server

25 thoughts on “Automate Emails Using Python! Build An Automatic Payment Reminder & Schedule Your Scripts Online

  • hi, I have tried this code in my Outlook (office365) & it's not working & not sending any mail & strange thing is it is not showing any error when I have run this

  • What is the program on which you wrote the rotation of the device "python-dotenv pip install panads . please

  • 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

  • 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. 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 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

  • 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

  • (code, resp) = self.auth(

    ^^^^^^^^^^

    authobject(challenge).encode('ascii'), eol='')

    I keep running into this error, can someone help?

  • 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:UsersKervinDesktopProjectHOmain.py", line 40, in <module>

    result = query_data_and_send_emails(df)

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "C:UsersKervinDesktopProjectHOmain.py", line 24, in query_data_and_send_emails

    send_email(

    File "C:UsersKervinDesktopProjectHOsend_email.py", line 79, in send_email

    server.sendmail(sender_email, recipient_list, msg.as_string())

    File "C:UsersKervinAppDataLocalProgramsPythonPython311Libsmtplib.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 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:UsersKervinDesktopProjectmain.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

  • hey, what if i have an own domain managed by google workspace?

  • I ran the code and it gave me the below:

    C:UserstguluPycharmProjectsCal1venvScriptspython.exe C:UserstguluPycharmProjectsCal1send_email.py

    Traceback (most recent call last):

    File "C:UserstguluPycharmProjectsCal1send_email.py", line 66, in <module>

    send_email(

    File "C:UserstguluPycharmProjectsCal1send_email.py", line 61, in send_email

    server.login(sender_email, password_email)

    File "C:UserstguluAppDataLocalProgramsPythonPython39libsmtplib.py", line 750, in login

    raise last_exception

    File "C:UserstguluAppDataLocalProgramsPythonPython39libsmtplib.py", line 739, in login

    (code, resp) = self.auth(

    File "C:UserstguluAppDataLocalProgramsPythonPython39libsmtplib.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.

  • Im trying to add CC in my emails.
    the Email address is reflected in the email however it is not receive by the person.

  • now how to check your email using python.. 🙂

  • 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?

  • I'm getting this error "SmtpClientAuthentication is disabled for the Tenant". Is there another way of sending emails without using smtplib?

  • patrick can u create the tutorial for deta space? because deta will shuting down and migrate to deta space 😍

Comments are closed.