from faker import Faker
import random
import requests
from pprint import pprint
headers = {‘Mailsac-Key’: ‘*************************************’}
def main():
ask = input('How many e-mails you want?: ')
try:
ask = int(ask)
except:
raise ValueError('Enter an integer')
for i in range(ask):
domains = ['@pridemail.co' , '@zingermail.co' , '@whoamail.co' , '@oofmail.co']
fake = Faker()
name = fake.name()
name1 = name
name = name.replace(" ","")
name = name.lower()
num = random.randint(0,1000)
num = str(num)
mail_pre = name
mail_pre += num
url = "https://mailsac.com/api/validations/addresses/"
domain = random.choice(domains)
full_email = mail_pre+domain
mail_check_url = url+mail_pre+domain
print(name1)
print(full_email)
print(mail_check_url)
print('======================')
r = requests.get(mail_check_url, headers=headers)
pprint(r.json())
main()