This script allows you to send automated emails using a Gmail account. It uses the smtplib
library to establish a secure connection to the SMTP server and the email
library to create and send the email.
Before running the script, make sure you have the following:
- Python 3 installed on your machine
- A Gmail account with "Less Secure Apps" access enabled. You can enable this feature in your Gmail account settings.
-
Clone or download the repository to your local machine.
-
Install the required dependencies by running the following command:
pip install -r requirements.txt
-
Open the
script.py
file in a text editor. -
Modify the following variables according to your needs:
sender
: A list containing your Gmail address and your name.receiver_email
: The email address of the recipient.message["Subject"]
: The subject of the email.message["From"]
: The name of the sender.html
: The HTML content of the email.
-
Save the changes.
-
Run the script by executing the following command:
python script.py
The script will prompt you to enter the password for your Gmail account.
-
The script will send the email and display a success message if the email is sent successfully. If there are any errors, the script will display an error message.
- Name: KHAOUITI ABDELHAKIM
- GitHub: @khaouitiabdelhakim
This project is licensed under the MIT License.