Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dubt on API response

sal21

Programmer
Apr 26, 2004
445
IT
Option Explicit
Sub TEST2()

Dim objCurlHttp As Object
Dim strResult As String
Dim varReqToken As Variant
Dim strWebServiceUrl As String
Dim strOwnerKey As String
Dim strQry As String, MYEMAYL As String

MYEMAYL = "gss.italy@iol.it"

strWebServiceUrl = "https://api.apilayer.com/email_verification/" & MYEMAYL
strOwnerKey = "99999999999999999999999"

Set objCurlHttp = CreateObject("MSXML2.serverXMLHTTP")

With objCurlHttp

.Open "GET", strWebServiceUrl, False
.setRequestHeader "cache-control", "no-cache"
.setRequestHeader "Content-type", "application/json; charset=utf-8"
.setRequestHeader "Content-type", "Accept"
.setRequestHeader "apikey", strOwnerKey
.send

strResult = .responseText

Debug.Print .Status
Debug.Print .getAllResponseHeaders
Debug.Print strResult

End With

Set objCurlHttp = Nothing

End Sub

see the result of debug.print:

200

Connection: keep-alive
Date: Tue, 28 Jan 2025 17:44:04 GMT
Content-Length: 389
Content-Type: application/json
Server: cloudflare
X-Cloud-Trace-Context: 217ba070ab6075e4109d6e7b7f8d8750
Access-Control-Allow-Origin: *
X-RateLimit-Limit-Month: 100
X-RateLimit-Remaining-Day: 81
RateLimit-Reset: 195356
RateLimit-Limit: 100
RateLimit-Remaining: 81
X-RateLimit-Limit-Day: 100
X-RateLimit-Remaining-Month: 81
cf-cache-status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=i3ZMekmCw%2Bio9S4cyoM3v7tiuPtu4wU04%2ByYWdOP4RlZc8qEsECKATKaVsk69Qh5PYWzgicdmsO2T2sWSmYaqdfvlOYFVRINb9obZC6DXjc6ap7lS2mhfGEjQv10vRMhLTmvGTaaOnpg3AsdoVI%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Strict-Transport-Security: max-age=2592000; includeSubDomains
X-Content-Type-Options: nosniff
CF-RAY: 9092c9d40bd5edaf-MXP
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=64719&min_rtt=52458&rtt_var=28467&sent=11&recv=11&lost=0&retrans=1&sent_bytes=5932&recv_bytes=1249&delivery_rate=32463&cwnd=256&unsent_bytes=0&cid=ce0c12e80c1a77a8&ts=59714&x=0"

{
"email": "gss.italy@iol.it",
"did_you_mean": "",
"user": "gss.italy",
"domain": "iol.it",
"syntax_valid": true,
"is_disposable": false,
"is_role_account": false,
"is_catch_all": false,
"is_deliverable": false,
"can_connect_smtp": false,
"is_inbox_full": "",
"is_disabled": "",
"mx_records": true,
"free": true,
"score": 0.48
}

the email address is corect? or not?
 
Based on the API response, the email gss.italy@iol.it is not fully valid for delivery.

A quick breakdown ---
  1. syntax_valid: true -- The email format is syntactically correct.
  2. is_disposable: false -- The email is not from a disposable email service.
  3. is_deliverable: false -- The email is not deliverable (the server likely failed to verify its existence).
  4. can_connect_smtp: false -- The server could not establish an SMTP connection to confirm the mailbox's existence.
  5. mx_records: true -- The domain iol.it has valid MX (Mail Exchange) records, meaning the domain can receive emails.
  6. score: 0.48 -- The score (likely a confidence score) is below a typical threshold (e.g., 0.8 or higher for reliable validity).
 
but Is my personal email and i use about 12 years!
 
Last edited:
This is not a vb6 question. This is a question about a proprietary REST API. What does the API documentations say?

>could not establish an SMTP connection to confirm the mailbox's existence
SMTP has no real capability confirm or deny existence of a mailbox (at best it can provide a somewhat vague idea of whether a mailbox is 'unavailable' or not on a particular server). Yes, there are extended/enhanced response codes that can indicate more detailed information about a target mailbox but they are not mandatory

This makes me treat this mailbox validation service (at least the SMTP element) with scepticism - I personally wouldn't rely on the result, I'm afraid
 

Part and Inventory Search

Sponsor

Back
Top