Passive income through automated paidmails with Python

Passive income through automated paidmails with Python
Image copyright: Photo by Markus Spiske. Found on Pexels - Written from: Marco Griep

Passives Einkommen durch automatisierte Paidmails mit Python

A few months ago I ventured into the topic of paidmails. If you think I’ve gone crazy, this article might prove you wrong… Maybe.


Always on the lookout for ways to earn money on the side as passively as possible, I came across the topic of paid surveys and paid emails. The latter is so primitive that it has its charm again. Who does not know paidmails: It is about reading emails regularly and receiving money for it. There are various ways of earning money with the paidmail providers. The easiest way to earn money is to simply let your mailbox be spammed and confirm the mails. Alternatively, you can also click through the so-called paid links, extra banners and forced texts in the portal of the paidmail provider and confirm them. The confirmation is only a timer that expires, as long as the expired, you must remain on the website. After the timer expires, you will receive your points. From a certain amount (usually 5 euros) you can withdraw your earnings. The principle is so primitive and banal that it can be easily automated. Most paidmail providers use the same system (Paidmail Pro 3) and simply have a different design. Using the Google search engine, you can easily find the providers by typing:

intext: Paidmail+Pro+3.0

As a rule, the version of Paidmail is always indicated in the footer of the websites. 

But who sits down all day in front of the computer to click hundreds of links to earn 10 cents a day? Hopefully nobody! As a programmer, I have simply sat down to a Python bot, which on the one hand retrieves my e-mails via IMAP and confirms them. On the other hand there is a bot that takes care of the paidlinks (forcedtext, extrabanner etc.).

For the paidmails I use a dedicated mailbox. I don’t want to get hundreds of paidmails in my normal mailbox. After retrieving the paidmails the email will be deleted. 

The other bot that takes care of the paidlinks logs in regularly to the paidmail operator, identifies the paidlinks and paidbanners and confirms them as well. Both bots are running on a Raspberry Pi 4* on which my IPFire is also running. IPFire then also directly blocks all advertising banners and trackers. 

Monthly earnings for November 2020

Last month my bot earned 4,54 € with 8 paidmail providers. And the bot confirms both paidmails and all paidlinks! Worthwhile? Rather not. Especially not if I have to pay extra for electricity or hardware. Since my IPFire is running anyway, the bot can happily continue to generate money on the side. 4,54 € per month is not much, but 50 Euro per year by doing nothing.

Paidmail Bot income summary

The Python bot for confirming emails

from imbox import Imbox
import time
from bs4 import BeautifulSoup
import webbrowser
import random
import time
import os

isLinux = False
browserExe = "chromium"

MAX_OPENED_TABS = 10

#windows
if not isLinux:
    browserExe = "chrome.exe"

while(True):
    with Imbox('imap.gmx.net',
            username='<ENTER-USERNAME>',
            password='<ENTER-PASSWORD>',
            ssl=False,
            ssl_context=None,
            starttls=True) as imbox:

        #all_inbox_messages = imbox.messages(unread=True)
        all_inbox_messages = imbox.messages()

        opened = 0

        for uid, message in all_inbox_messages:
            print(message.subject)
            print(message.body)
            email_body = str(message.body)
            soup = BeautifulSoup(email_body, 'html.parser')
            urls = soup.findAll ('a')
            for url in urls:
                if url['href'].find("pmail.php") == -1:
                    print('Not a paidlink')
                else:
                    print(url['href'])
                    webbrowser.open_new_tab(url['href'])
                    opened = opened+1
                    imbox.delete(uid)
                    wait = random.randint(0,15)
                    while(wait > 0):
                        wait = wait-1
                        time.sleep(1)
                        print("Warte: " + str(wait))

                        if (opened >= MAX_OPENED_TABS):
                            opened = 0
                            wait = 120
                            while(wait > 0):
                                wait = wait-1
                                time.sleep(1)
                                print("Warte auf Browser Reset " + str(wait))
                            if not isLinux:
                                os.system("taskkill /f /im "+browserExe)
                            else:
                                os.system("pkill "+browserExe)

    wait = 43200 # Warte 12 Stunden wenn alle Mails abgearbeitet wurden
    while(wait > 0):
        wait = wait-1
        time.sleep(1)
        print("Warte 12 Stunden auf neue Mails - Restcountdown: " + str(wait))
from selenium import webdriver
from selenium.webdriver import Chrome
from selenium.webdriver.common.keys import Keys
from selenium.common import exceptions
import time
import requests
from bs4 import BeautifulSoup
import smtplib
import datetime
import mysql.connector
import random
from selenium.webdriver.chrome.options import Options
import os

class Paidmailer:
    base_url = ""
    login_url = ""
    user_id = ""
    user_pwd = ""

    def __init__(self, base, login, userid, password):
        self.base_url = base
        self.login_url = login
        self.user_id = userid
        self.user_pwd = password


def run(pm, linkUrl, SearchTag, wait = 125, maxtabs = 5):
    driver = webdriver.Chrome()
    driver.get(pm.base_url)
    driver.delete_all_cookies()
    time.sleep(30)

    try:
        dict = {'userid': pm.user_id, 'userpsw': pm.user_pwd, 'login_members': 'Einloggen'}
        cookieInject =  {'cookie_ok': '1'}
        session = requests.session()
        response = session.post(pm.login_url, data=dict, cookies=cookieInject)
        if (response.ok):
            # ForcedBanner Identiifzieren
            response_text = session.get(pm.base_url + linkUrl, cookies=cookieInject)
            soup = BeautifulSoup(response_text.content, 'html.parser')

            tags=soup.findAll('a', href=True)
                                
            # Cookies
            first = True 

            for cookie in session.cookies:  # session cookies
                print("name:" + cookie.name + " value:" + cookie.value + " domain:" + cookie.domain + " secure:" + str(cookie.secure))
                cookie_dict = {'domain': cookie.domain, 'name': cookie.name, 'value': cookie.value, 'secure': cookie.secure}
                if cookie.expires:
                    cookie_dict['expiry'] = cookie.expires
                if cookie.path_specified:
                    cookie_dict['path'] = cookie.path

                driver.add_cookie(cookie_dict)
            if first:
                first = False #test session cookie überspringen
            else:
                driver.add_cookie(cookie_dict)

            cookie_dictInject = { 'name': 'cookie_ok', 'value': '1' }
            driver.add_cookie(cookie_dictInject)

            i = 0
            for a in tags:
                try:
                    if a['href'].find("#") != -1:
                        #if a.contents[0].contains("Guthaben"): # Gültig für Powermails zumindest
                        print(a.contents[0].strip())
                except:
                    pass

                if a['href'].find(SearchTag) != -1:
                    i = i+1
                    print(a['href'])

                    driver.execute_script("window.open('','_blank');")
                    driver.switch_to.window(driver.window_handles[i])

                    driver.get(pm.base_url + '/members/' + a['href'])

                    t = 1

                    if i >= maxtabs:
                        t = wait
                
                    while (t >= 0):
                        t = t-1
                        print("Waiting: " + str(t))
                        time.sleep(1)

    except exceptions.InvalidCookieDomainException as ex:
        print(ex.message)
    except Exception as e:
        print(e)
    finally:
        time.sleep(60)
        driver.close()
        os.system("pkill chromium")


def bootstrap(pm):
    try:
        if DoPaidmail:
            run(pm, "/members/pmail.php", 'pmail.php?', 135, 4)
            time.sleep(30)

        if DoForcedBanner:
            run(pm, "/members/forcedbanner.php", 'forcedbanner2.php?')
            time.sleep(30)

        if DoForcedText:
            run(pm, "/members/forcedtext.php", 'forcedtext2.php?', 60, 5)
            time.sleep(30)

        if DoExtraBanner:
            run(pm, "/members/extrabanner.php", 'extrabanner2.php?', 90, 1)
            time.sleep(30)

    except Exception as e:
        print(e)


headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"}

DoForcedBanner = True
DoPaidmail = False
DoForcedText = True
DoExtraBanner = True

paidmailers = []
paidmailers.append(Paidmailer("http://www.markis-mailer.eu", "http://www.markis-mailer.eu/index.php", "<ENTER-USER-ID>", "<ENTER-USER-PASSWORD>"))
paidmailers.append(Paidmailer("https://www.talk-mailer.de", "https://www.talk-mailer.de/index.php", "<ENTER-USER-ID>", "<ENTER-USER-PASSWORD>"))
paidmailers.append(Paidmailer("http://www.mailbang.de", "http://www.mailbang.de/index.php", "<ENTER-USER-ID>", "<ENTER-USER-PASSWORD>"))
paidmailers.append(Paidmailer("http://www.powermails.de", "http://www.powermails.de/login.php", "<ENTER-USER-ID>", "<ENTER-USER-PASSWORD>"))
paidmailers.append(Paidmailer("http://www.euros-4-mails.de", "http://www.euros-4-mails.de/login.php", "<ENTER-USER-ID>", "<ENTER-USER-PASSWORD>"))

lastIndex = -1

while True:
    
    i = random.randrange(0, len(paidmailers))
    if (lastIndex == -i): #if next paidmailer is the same as before
        continue
    
    
    lastIndex = i
    bootstrap(paidmailers[i])
    os.system("pkill chromium")

Summary

Who can I recommend paidmails to? Manually no one. Otherwise, all people who have hardware at home anyway that runs around the clock. Even if I buy a Raspberry Pi 4* for Paidmails at the moment, I need a whole year to recover the costs. Since my IPFire is running anyway, I’ll let the whole thing run and report here on my blog regularly.

Don’t forget to buy me a coffee, should you use the script. Thanks