0
嗨我想驗證電子郵件地址,我找到郵件側衛電子郵件驗證python庫,但它不工作。Mailgun側文電子郵件驗證不起作用
>>> from flanker.addresslib import address
>>>
>>> address.validate_address('[email protected]')
None
請幫幫我!
謝謝
嗨我想驗證電子郵件地址,我找到郵件側衛電子郵件驗證python庫,但它不工作。Mailgun側文電子郵件驗證不起作用
>>> from flanker.addresslib import address
>>>
>>> address.validate_address('[email protected]')
None
請幫幫我!
謝謝
例如,最好使用mailgun api validor。
def get_validate():
return requests.get(
"https://api.mailgun.net/v3/address/validate",
auth=("api", "pubkey-5ogiflzbnjrljiky49qxsiozqef5jxp7"),
params={"address": "[email protected]"}
例子:https://github.com/diegovalle/crimenmexico/blob/master/api/forms.py
view.py:
def get_validate(email):
return requests.get(
"https://api.mailgun.net/v3/address/validate",
auth=("api", "pubkey-f387c7feae844803cdda9c99d4b976cb"),
params={'address': email})
rq = get_validate(email)
if rq is not None:
data_email = rq.json()
if data_email['is_valid'] == False:
if data_email['did_you_mean'] is not None:
print("Error, Wrong Email")
else:
print("Error, Wrong Email")
else:
print("Ok, Email Correct")
你找到這個問題的解決方案? – anandh