XanzyX Posted October 20, 2018 Share Posted October 20, 2018 I have a client (healthcare provider) that has a HUGE database (28 million records). They need to send out a mass email to their clients, both past and present. They want me to check all the emails addresses for valididy. I wrote a function that checked to domains to see if they exist. I wrote: Func _CheckDomain($sDomain) TCPStartup() If TCPNameToIP($sDomain) <> "" Then Return 1 EndIf TCPShutdown() If Ping($sDomain) > 1 Then Return 1 EndIf Return 0 EndFunc ;==>_CheckDomain I checked the results agaimst GoDaddy.com's Bulk Domain search to fimd a number of the domains that the function marked as non-existant were "Taken". I took those domain names and plugged them into a broswer to find that the domain, infact existed. I added: If StringLen(_INetGetSource($sDomain)) > 1 Then Return 1 EndIf I got even less "Taken" domains, but none the less I can't capture only the invalid domains. I even added: If StringLen(_INetGetSource("http://" & $sDomain)) > 1 Then Return 1 EndIf If StringLen(_INetGetSource("https://" & $sDomain)) > 1 Then Return 1 EndIf I got a better result. Am I missing something? Is there a sureshot way to check a domain's existance? Link to comment Share on other sites More sharing options...
water Posted October 20, 2018 Share Posted October 20, 2018 Did you search the forum? IIRC this subject has been discussed a few times. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
XanzyX Posted October 20, 2018 Author Share Posted October 20, 2018 Sorry for that. I am nearly blind and it is very hard to search. IIRC seems like a good place to strart Thanx ; Link to comment Share on other sites More sharing options...
water Posted October 20, 2018 Share Posted October 20, 2018 (edited) IIRC isn't a place it is an abbreviation for: If I remember correctly I will search as well and post my findings here Edited October 20, 2018 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
XanzyX Posted October 20, 2018 Author Share Posted October 20, 2018 Thanx Im getting many Active Directory domains in the search results Link to comment Share on other sites More sharing options...
water Posted October 20, 2018 Share Posted October 20, 2018 What exactly do you mean by "Active Directory domains"? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted October 20, 2018 Share Posted October 20, 2018 Have you tried NSLOOKUP or is this blocked by your security systems? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
XanzyX Posted October 20, 2018 Author Share Posted October 20, 2018 Active Diretory pertains to Micososoft Domains in Active Directory Link to comment Share on other sites More sharing options...
XanzyX Posted October 20, 2018 Author Share Posted October 20, 2018 I found out, in other forums that to increase the timout to at leasr 700 and you will get better results, If Ping($sDomain, 700) > 1 Then Return 1 EndIf I reran the script and I recieved way better results. The domains that were "Taken" were not in use. Thanx again QED Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 20, 2018 Moderators Share Posted October 20, 2018 (edited) Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Edited October 20, 2018 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
TheXman Posted October 20, 2018 Share Posted October 20, 2018 (edited) 3 hours ago, XanzyX said: They want me to check all the emails addresses for valididy. I wrote a function that checked to domains to see if they exist. Obviously you spent no time trying to Google the subject of checking the existence of email addresses. First and foremost, trying to check the validity of an email address by verifying the existence of the email address' domain is like trying to check the validity of a specific street address by verifying that the street exists. Probably the best way to check the validity of a specific email address, but still not 100% foolproof, would be to write a function that queried for the domain's MX record and then started a SMTP conversation with the MX server to see if you get a valid response from the "rcpt to:" command. But like I said, that may not work 100% because of security measures. Also, most ISPs these days block port 25 (SMTP) for outbound connections. If yours is one of them, you will need to establish a SSL/TLS connection over the appropriate port for the SMTP server. Of course you could always use an email address verification service that has an API for you to consume. To be honest, there is no foolproof way to verify that any particular email address exists. If it is a mass mailing, why would you even try? If your "client" really wants stats about bounce backs, blocks, and the like, use a mass mailing service like SendGrid which can capture those sort of mass mailing stats for you. Why try to reinvent the wheel? Edited October 20, 2018 by TheXman Corrected typo CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
XanzyX Posted October 21, 2018 Author Share Posted October 21, 2018 Checking the validity of an email address by verifying the existence of the email address' domain is like trying to check the validity of a specific street address by verifying that the city the street address is in. Already I found 4,000 dead domains that will not have an email address attached yrt. Getting the MX records require a valid email address, signed in with a password. This is not something I can compile and offer other users. Link to comment Share on other sites More sharing options...
TheXman Posted October 21, 2018 Share Posted October 21, 2018 5 minutes ago, XanzyX said: Getting the MX records require a valid email address, signed in with a password. You obviously are in way over your head and haven't a clue what you're talking about as it relates to DNS or SMTP. Getting the MX record(s) for a domain does NOT require a valid email address or a password. It is merely querying DNS for the MX record of the email address' domain. You appear to be trying to perform surgery when you haven't even finished high school. What makes it worst, is that you think you actually know what you are talking about, Good luck with your little endeavor. Hopefully someone else will take you by the hand and try to help you learn the basics of DNS and SMTP. Until then, keep CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
XanzyX Posted October 21, 2018 Author Share Posted October 21, 2018 (edited) Thank you. You are so kind. You should coach Little League Not one bit of code to share Not one bit of encouragement Not one bit of ideas or helpful advice Only harsh criticism which was a backhanded way to exult yourself You smugly proclaim that I “Obviously are in way over your head and haven't a clue what you're talking about” as if you are the only one that has an idea Did you try to help me with a code line or two? Did you offer your vast knowledge to me and to others that have the same questions? No! You told everyone in this forum how arrogant and self-righteous you are. I would hate to see how you would give advice to a 14 year old child trying to start out with coding in AutoIT. You, are obviously in way over your head and you haven’t a clue how to help others in a humble manner. Edited October 21, 2018 by XanzyX Link to comment Share on other sites More sharing options...
XanzyX Posted October 21, 2018 Author Share Posted October 21, 2018 $sPing = Ping($sDomain, 700) If @error > 0 Then Return 0 ; No Good Else Return 1 ; Good EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now