Send emails using Python's smtplib
and email
libraries. This project provides a simple script for sending emails programmatically.
The Send Mail Using Python project enables you to send emails using a Python script. It uses the smtplib
library for establishing an SMTP connection and the email
library for creating and formatting email messages.
- Easy Configuration: Set up sender's email, password, recipient's email, subject, and message directly in the script.
- Dynamic Email Content: Customize the email subject and message content based on user input.
- Secure SMTP Connection: Utilizes a secure SMTP connection for sending emails.
Ensure you have Python installed on your system.
-
Clone the GitHub repository:
git clone https://github.com/codeterrayt/sendmailusingpython.git cd sendmailusingpython
-
Open
main.py
in a text editor. -
Configure the following variables:
server_login_mail
: Your email address for SMTP login.server_login_password
: Your email password for SMTP login.
-
Save the changes.
-
Run the script:
python main.py
-
The script will prompt you for the recipient's email, subject, and message. Enter the details, and the email will be sent.
-
Execute the script in a terminal.
-
Enter the recipient's email address when prompted.
-
Enter the subject and message content as instructed.
-
The script will send the email, and you will see a confirmation message.
Feel free to explore and modify the code to suit your specific needs. You can extend the functionality, add attachments, or integrate it into a larger project.
This project uses the smtplib
and email
libraries for sending emails. Explore the Python smtplib
Documentation and Python email
Documentation for more information.
๐ค Happy Email Sending with Python! ๐