Git Product home page Git Product logo

pyagmail

A python script that use gmail and csv file to send email to lists

┏━┓╋╋╋╋╋╋╋╋╋╋╋╋┏┓
┃╋┣┳┳━┓┏━┳━━┳━┓┣╋┓
┃┏┫┃┃╋┗┫╋┃┃┃┃╋┗┫┃┗┓
┗┛┣┓┣━━╋┓┣┻┻┻━━┻┻━┛
╋╋┗━┛╋╋┗━┛

Prerequisites

You need to allow the sender gmail account to use unsecure app via:

https://support.google.com/cloudidentity/answer/6260879?hl=en

Or setup the script and yagmail to use OAuth2 autorization:

https://yagmail.readthedocs.io/en/latest/setup.html#installing-from-pypi

(maibe) Build animation package

Usage

Works with python 2.7, not tested with python3.

The scripts require some pyton packages (pip install package-name):

Start the script

  • Create a email-list.csv file

In this file, will be read the email list to which to send the emails, for each line a different email, the script will scan this file, line by line, and send the emails to each address read. the first line of the file is not read by the script (you can name as you wish, remember to put the same name into config.py file and put in the same path of the project and use .csv extension).

  • Create a filename-of-the-body.txt file:

This file contain the body of the email you need to use the right encode.

For me, the solution of using a txt file worked well, in the sense that for special characters I didn't have to make any changes for the encoding problems, the example txt file is the original one, without modifications, that I used for send emails, I use the plain text format and not the HTML format, which I have not tested yet.

This file contain the body of the email you need to use the right encode, to be read correctly by the python interpreter, in this file there are some reference links and documentation to understand the problem (you can name as you wish, remember to put the same name into config.py file and put in the same path of the project and use .txt extension).

  • Edit the file config.py all entered values must be contained in quotes '' (apart timer field, it don't need '') :
email = {'subject': 'Put here the email subject',
        'body': 'filename-of-the-body.txt',
        'email': '[email protected]',
        'passwd': 'SenderPassword',
        'timer': 100,
        'file': 'email-list.csv',
        'log_email': '[email protected]'}

The timer field is the time expressed in seconds between sending an email and the other, the value 100 is about 2 minutes.

  • Run for 1 time the keyring-registration.py file set the same password of your sender email password:
python keyring-registration.py

This will store into linux keyring system the yagmail autorization to use and run the machine.

  • Run the pyagmail.py script to start sending mail:
python pyagmail.py

launching the script you will need to leave the terminal window open to complete it, otherwise it will stop.

Since, depending on the length of the list, the execution of the script may take days, to overcome the problem of keeping the terminal open, if you use linux, you can take advantage of tmux to launch the script in the background:

Some solution to run in background with windows:

To Do

  • Loading ideas...
  • Build setup file
  • Implementing OAut2 for gmail secure apps
  • Made plain and html version of the emails
  • Set digital signature to emails in gmail
  • Adding animation when script is runnig
  • Configuring keyring
  • Set google account to operate with in less security apps (google account option option security)
  • Set autoreply message in gmail to tell users where can contact you (using gmail account settings to do this)

Used resouces

Usefull resources:

Gmail stats

To do

  • Loading...
┏━━┳┓╋╋╋╋╋╋┏┓┏━┓
┗┓┏┫┗┳━┓┏━┳┫┣┫━┫
╋┃┃┃┃┃╋┗┫┃┃┃━╋━┃
╋┗┛┗┻┻━━┻┻━┻┻┻━┛

┏━━━┓
┃┏━━┛
┃┗━━┳━━┳━┓┏┓┏┳━━┳┳━┓┏━━┓
┃┏━━┫┏┓┃┏┛┃┃┃┃━━╋┫┏┓┫┏┓┃
┃┃╋╋┃┗┛┃┃╋┃┗┛┣━━┃┃┃┃┃┗┛┃
┗┛╋╋┗━━┻┛╋┗━━┻━━┻┻┛┗┻━┓┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏━┛┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗━━┛

┏━┓╋╋╋╋╋╋╋╋╋╋╋╋┏┓
┃╋┣┳┳━┓┏━┳━━┳━┓┣╋┓
┃┏┫┃┃╋┗┫╋┃┃┃┃╋┗┫┃┗┓
┗┛┣┓┣━━╋┓┣┻┻┻━━┻┻━┛
╋╋┗━┛╋╋┗━┛

Pyagmail's Projects

alf.io icon alf.io

alf.io - The open source ticket reservation system for conferences, trade shows, workshops, meetups

cryinglinked icon cryinglinked

Another information gathering tool written in python that scrapes linkedin.com with given company url and generates email addresses from employee names

dark-fantasy-hack-tool icon dark-fantasy-hack-tool

DDOS Tool: To take down small websites with HTTP FLOOD. Port scanner: To know the open ports of a site. FTP Password Cracker: To hack file system of websites.. Banner Grabber: To get the service or software running on a port. (After knowing the software running google for its vulnerabilities.) Web Spider: For gathering web application hacking information. Email scraper: To get all emails related to a webpage IMDB Rating: Easy way to access the movie database. Both .exe(compressed as zip) and .py versions are available in files.

dbxcli icon dbxcli

A command line client for Dropbox built using the Go SDK

django icon django

The Web framework for perfectionists with deadlines.

email-extractor icon email-extractor

The main functionality is to extract all the emails from one or several URLs - La funcionalidad principal es extraer todos los correos electrónicos de una o varias Url

email-scraper-1 icon email-scraper-1

Simple tool for scraping millions (billions?) of email addresses from the Internet®

email_scraper icon email_scraper

This is a tool a made for a pen testing class I took. It takes in a domain and scrapes that page looking for emails and additional URLs to scrape.

googlescraper icon googlescraper

A Python module to scrape several search engines (like Google, Yandex, Bing, Duckduckgo, ...). Including asynchronous networking support.

instabot icon instabot

🐙 Free Instagram scripts, bots and Python API wrapper. Get free instagram followers with our auto like, auto follow and other scripts!

instagram-api-python icon instagram-api-python

Unofficial instagram API, give you access to ALL instagram features (like, follow, upload photo and video and etc)! Write on python.

mailspotter icon mailspotter

A tool for scraping email addresses from web search results.

nodemailer icon nodemailer

✉️ Send e-mails with Node.JS – easy as cake!

odoo icon odoo

Odoo. Open Source Apps To Grow Your Business.

paasta icon paasta

An open, distributed platform as a service

pandas icon pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more

pyagmail icon pyagmail

A python script that use gmail and csv file to send email to lists

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.