Skip to main content

Search for emails in the wild

Project description

Mailpapa

pip install mailpapa
import mailpapa

res = mailpapa.search(company='safaricom', domain="safaricom.co.ke")

emails = res.emails

for email in emails:
    print(email.address)
    print(email.name)
    print(email.position)

# unfortunately linkedin hates crawling, this causes mailpapa to return an empty response.emails

#To make it easier and avoid Exceptions use

if res.ok:
  for email in res.emails:
    print(email.address)
    print(email.name)
    print(email.position)

Mailpapa accepts diiferent email patterns. By defaults it uses firstname.lastname@domain

first_last = mailpapa.ACCEPTED_PATTERNS.FIRST_LAST
res = mailpapa.search(company='safaricom', domain="safaricom.co.ke", pattern=first_last)

The following patterns are supported

import mailpapa

mailpapa.ACCEPTED_PATTERNS.FIRSTLAST # johndoe@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LASTFIRST # doejohn@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LAST # doe@contosdo.com
mailpapa.ACCEPTED_PATTERNS.FIRST # john@contosdo.com
mailpapa.ACCEPTED_PATTERNS.FIRST_LAST # john_doe@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LAST_FIRST # doe_john@contosdo.com
mailpapa.ACCEPTED_PATTERNS.FIRSTDOTLAST # john.doe@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LASTDOTFIRST # doe.john@contosdo.com
mailpapa.ACCEPTED_PATTERNS.FLAST # jdoe@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LFIRST # djohn@contosdo.com
mailpapa.ACCEPTED_PATTERNS.FIRSTL #johnd@contosdo.com
mailpapa.ACCEPTED_PATTERNS.LASTF # doej@contosdo.com

Mailpapa also allows you to search multiple role. Defaults to ceo

roles = ["sales", "ceo", "finance"]

mailpapa.search(company='safaricom', domain="safaricom.co.ke", positions=roles)

# OR

mailpapa.search(company='safaricom', domain="safaricom.co.ke", positions="sales")

CLI

mailpapa -h

usage: mailpapa [-h] [-p PATTERN] [-r ROLE] [-j file] company domain

Search for Emails in the Wild

positional arguments:
  company               Company name
  domain                Company domain

optional arguments:
  -h, --help            show this help message and exit
  -p PATTERN, --pattern PATTERN
                        Email Pattern
  -r ROLE, --role ROLE  Employee Positions

Save Options:
  -j file, --json file  Save emails in a JSON file in the given location.
>>> mailpapa safaricom safaricom.co.ke -r sales

----------------------  ------------------------------------
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
Hidden Name           hidden.name@safaricom.co.ke
----------------------  ------------------------------------

How about we send email

config={
  "password": os.environ.get("SMTP_PASS", None),
  "host": os.environ.get("SMTP_HOST", None),
  "port": int(os.environ.get("SMTP_PORT", None))
}

# Params
email.sendmail(sender: str = None, subject: str = None, body: str = None, html: bool = False, config: dict =None)

email = res.emails[0]
email.sendmail(
    "myemail@contosdo.com", #sender
    subject="Canton Fair",
    body="Did you get the ticket to canton?",
    config=config
    )

https://support.google.com/accounts/answer/6010255

https://myaccount.google.com/lesssecureapps

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailpapa-0.1.5.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

mailpapa-0.1.5-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mailpapa-0.1.5.tar.gz.

File metadata

  • Download URL: mailpapa-0.1.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for mailpapa-0.1.5.tar.gz
Algorithm Hash digest
SHA256 eebcc39e9e8372406723fd77f895dfc5ae7482bd289abb7d9ebbf75e9d10b1fd
MD5 a3bf22ed92e3dd1811dfcf10e93f39d5
BLAKE2b-256 c09c88df6d333962af8f4847e43f8ff923451d8001f7ee5db41ead56d21a76cb

See more details on using hashes here.

File details

Details for the file mailpapa-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: mailpapa-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for mailpapa-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 adab743b34b13ea9e708f5eb0991681ec45bc9afa99f3fdd740f75ff0728fc65
MD5 aa5297ed275450bea8b2c005ad496077
BLAKE2b-256 6f09ca3b34a4491f9bc56b101bf39b9b0b03b189992bb48fab7c0a53f1dc212f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page