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 biv343 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

Status
Not open for further replies.

sal21

Programmer
Apr 26, 2004
463
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
 
Hi strongm,
but in any case i would need to know if the email was received correctly.
Have an idea?

note:
can i also change the code to send the email
 
would need to know if the email was received correctly.
This is a far from trivial task - email protocols do not incorporate this kind of functionality natively and whiel there are some things that might help they all have inherent flaws

Email read receipts - my email client can be configured to ignore the read receipt request
HTML email web call - There are numerous techniques where a HTML formatted email can call out to webserver and POST/GET information. However most modern mail clients and AV tools will offer to block this.

In a commercial usage, I'd look very closely at the privacy and regulatory environment before I went too much further.
 
>but in any case i would need to know if the email was received correctly.

And I'll repeat what I (and now others ) have said: this functionality is not really a part of SMTP. So 1) No, and 2) not really a VB6 question

>can i also change the code to send the email

No. the mailboxlayer api - which is what you are using - has a very singular purpose. You can't somehow use it to send email instead. And APILayer, who provide the service, don't have a mail sending API (as far as I can see). So you would need to find a provider with a REST API for sending mail - an example of which I provided to you 5 days ago in https://www.tek-tips.com/threads/send-email-with-a-free-sever-smpt-api-rest.1832869/

Hereit is again, just in case: https://postmarkapp.com/lp/postmark-email-api
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top