Skip to content

deliarm/Python-Email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python-Email

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

What things you need to install and how to install them

Python version 3.0 or higher
smtp package 

To install simple mail transfer protocol (SMTP), type the following in your windows command prompt

pip install smtp

It should look like this

image

You now have the required software to run the script. Download the repository to your local machine and change lines 22 and 24. These lines are the sender and receiver emails, respectively.

Before You can Send

The account used to send the email(s) must change the following security setting.

Click your profile icon (top right of the google page) -> Manage your Google Account -> Security -> Less secure app access

Set this to "On" , if this is not on a secure connection cannot be made (due to built in security features of google). It should look like this

image

Now we are ready to execute in the command line. Make your way to the directory where the repository is downloaded and type the following command

python spammer.py

You will then be prompted to type your password for the email account you declared on line 22 and the number of times you wish to send the email (max is 10,000 per day on gmail). Here is what a successful execution looks like

image

If you would like to change the subject (aka header) of the email you can do so in line 25 of the script. You can also change the body of the email in the 'message.txt' file .

Disclaimer

I am not responsible for anything you do with this script, it is designed solely for learning purposes

References

https://docs.python.org/3/library/email.examples.html

https://docs.python.org/3/library/smtplib.html

https://realpython.com/python-send-email/

https://www.w3schools.com/python/python_file_open.asp