Yoshio Keima

💌 PyMailCat: Designing a Graphical Interface for Sending Emails in Python 🐈

No. Art. 1 Date: 25/June/2024

💌 PyMailCat: Designing a Graphical Interface for Sending Emails in Python 🐈

Main index:

  1. What is Dear PyGui?

  2. Dear PyGui vs Tkinter

  3. SMTP

  4. Google, Outlook and Yahoo

  5. PyMailCat: Structure

  6. Contributors

  7. References

1. What is Dear PyGui?

Dear PyGui Logo

Dear PyGui is an easy-to-use, dynamic, GPU-accelerated, cross-platform graphical user interface (GUI) toolkit for Python. It is "built with" Dear ImGui. Features include traditional GUI elements such as buttons, radio buttons, menus, and various methods for creating a functional layout. Additionally, DPG has an incredible variety of dynamic charts, tables, drawings, debugger, and multiple resource viewers. DPG is ideal for creating simple user interfaces as well as developing complex and demanding graphical interfaces. DPG offers a robust framework for developing scientific, engineering, gaming, data science and other applications that require fast and interactive interfaces [1].

Fist steps with Dear PyGui

In addition, it is open source. If you want to review more of the documentation (English) click here, If you want to see the Dear PyGui project click here to go Github repository.

2. Dear PyGui vs Tkinter

Tkinter already comes within the Python library when you install it [2]. In addition, it is a tool where documentation exists in Spanish as well as in English. Likewise, it has been possible to develop projects such as the development of video games, payment for a restaurant [3]. However, Dear PyGui is a more complete tool since it allows data analysis, projections and multi-platform management, which is extremely useful for the development of more complete tools. Although official documentation exists, errors or incidents may occur that can affect the development of software since it has to be investigated separately from the documentation.

3. SMTP

SMTP refers to the English Simple Mail Transfer Protocol, this service is still being used, we know it as email, in which we send messages through a computer or cell phone. Some of the companies that have their SMTP included are Google, Microsoft, and Yahoo too. Although there are also companies that have their own email domain.

The process when we send an email starts from us, that is, when we write an email and send it, we are known as MUA Message User Agent, then follows the MSA Message Submission Agent,in which you verify that you want to send an email. That is, when we write an email using Gmail, theMTA it's us and the MSA is Gmail. Afterwards, it is the MTA, Message Transfer Agent to make the explanation a little more simplified and returning to the previous example: Once the email has been sent from Gmail, our recipient uses, for example, an email that is from Outlook, then the MTA searches for servers on the Internet until it finds the Outlook server. At this point, the MX, Mail Exchanger, as the name says, they exchange Gmail and Outlook messages. Once the exchange has finished the Outlook server will send that information to your server, this process is known as MDA, Message Delivery Agent. Finally, the recipient receives the email and this is known as MRA, Mail Retrival Agent or it also becomes MUA [4][5][6][7][8][9].

This is how the email system works and also all the processes that exist. Below is an illustrative image of what was discussed in the previous paragraph.

SMTP protocol diagram, image taken from Wikipedia[10].

4. Google, Outlook y Yahoo

It is important to clarify that not only do these servers exist for sending emails, but they are the most common. Also let's remember the limits of an email. First of all, the size of an email cannot exceed more than 25 MB. On the other hand, the number of recipients cannot be more than 100 when we send an email. Finally, to use third-party apps using Google properties, you need to create an app password. If you are more interested in how to create an application password, please read the official documentation from Google.

5. PyMailCat: Structure

PyMailCat Logo

PyMailCat is a program designed with Dear PyGui that can send emails from a graphical interface, where the email server can be from Gmail, Outlook/ Hotmail, Yahoo . This program can send images (maximum up to 10), PDF files (maximum up to 10). Likewise, you can also enter your recipients (maximum 100) manually, an Excel file or it can also be CSV. The body of the email can be entered in the following formats txt, HTML, or it can also be entered manually. You can put all your recipients with blind copy (Bcc), likewise, you can enter your token or password through a txt file or manually.

To explain how it works, this program is divided into modules, one of which is the graphical interface that allows the user to view the fields to fill out. This is extremely important since it will send the corresponding information to the other module called SMTP, in which it is responsible for verifying that the data is correct and also in case of errors. try sending a message "Emails cannot be sent." Below is part of the interface code as well as the SMTP module. Note: Do not confuse the SMTP module with the one that comes from the default Python library which is SMTPLIB, they are independent.

For data processing, a separate module was used so that it could save and also obtain the data from the interface and thus the functionalities of the buttons. Finally, there is the main, where it is the entire execution of the program with all its components.

If you were interested in the project, you can go to the Github repository to read the documentation in more detail, likewise, I invite you to leave it a ⭐️ to the project.

6. Contributors.

7. References

  1. Dear PyGui documentation. Date: 21st June 2024. What & Why.

  2. Tkinter. Date: 21st June 2024. tkinter — Python interface to Tcl/Tk .

  3. GUI Billing System and Menu Card Using Python. Date: 22nd June 2024. Geeks for Geeks. Last update: 3rd June 2024. Geeks for Geeks.

  4. Email agent (infrastructure). Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Classification.

  5. Email client. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Email client.

  6. Message submission agent. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Message submission agent.

  7. Message transfer agent. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Message transfer agent.

  8. Message delivery agent. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Message delivery agent.

  9. Mail retrieval agent. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Mail retrieval agent.

  10. Simple Mail Transfer Protocol. Date: 22nd June 2024. Wikipedia, The Free Encyclopedia. Mail processing mode.