Ejemplo n.º 1
0
async def redis_checker(scope="redis_config"):
    test = DefaultChecker(db_provider="redis")
    test.redis_client = await  fakeredis.aioredis.create_redis_pool(encoding="UTF-8")
    await test.init_redis()
    yield test
    await test.redis_client.flushall()
    await test.close_connections()
Ejemplo n.º 2
0
async def default_checker() -> Type[DefaultChecker]:
    """
    Return email validator to ensure incoming email is legitimate.

    :returns: DefaultChecker
    """
    checker = (
        DefaultChecker()
    )  # you can pass source argument for your own email domains
    await checker.fetch_temp_email_domains()  # require to fetch temporary email domains
    return DefaultChecker
Ejemplo n.º 3
0
def default_checker():
    test = DefaultChecker()
    yield test
    del test
Ejemplo n.º 4
0
async def redis_checker(scope="redis_config"):
    test = DefaultChecker(db_provaider="redis")
    await test.init_redis()
    yield test
    await test.redis_client.flushall()
    await test.close_connections()
Ejemplo n.º 5
0
from fastapi_mail.email_utils import DefaultChecker, WhoIsXmlApi
import asyncio

checker = DefaultChecker(db_provaider="redis")
loop = asyncio.get_event_loop()
loop.run_until_complete(checker.init_redis())
res = loop.run_until_complete(checker.blacklist_rm_temp("promail1.net"))
print(res)
res = loop.run_until_complete(checker.temp_email_count())
loop.run_until_complete(checker.close_connections())


who_is = WhoIsXmlApi(token="Your access token", email = "*****@*****.**")

print(who_is.smtp_check_())  # check smtp server
print(who_is.is_dispasoble()) # check email is disposable or not
print(who_is.check_mx_record()) # check domain mx records 
print(who_is.free_check) # check email domain is free or not