Git Product home page Git Product logo

bulk-email-forwarding's Introduction

About

Python script to forward emails using Gmail.

Reason

As Gmail doesn't allow to forward multiple emails at once, I've created this script to help me do it.

Description

The script makes use of imaplib and smtplib libraries that are built-in in python.

Usage

To use the script there are a few changes you need to make:

  1. Change the USERNAME and the PASSWORD for your email account.
  2. Gmail, fortunately, by default, doesn't allow IMAP connections, as it is considered risky and unsecure. You will have to enable access for "Less secure apps" for this to work. Google gmail enable less secure apps and you'll find a way. Also, if you'll try the script before enabling "Less secure apps", Gmail will send you an email describing the problem and will show you the way to enable it.
  3. Change the SEARCH_CRITERIA according to your needs. You can find more documentation for this here: search command documentation
  4. Don't forget to disable less secure apps when you're done, for your safey.

Considerations

This script creates a new SMTP connection for each email forwarding. Gmail has lots of limits, among which, limits on how many emails you can send per minute or per day. I've also figured that Gmail didn't manage to execute each forward command when many commands were sent consecutively.

You can disable this limitation on your own and try sending more emails during a single connection, if you don't have lost of emails. I had 200+ emails and this is what worked for me. I've also enabled a 5 seconds time delay between each forward command, but you can easily change it. The constant name is TIME_DELAY.

Resources

Following articles can help get more knowledge on the topics:

bulk-email-forwarding's People

Contributors

vladimir-ionita avatar

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.