Steven Tester - 2020-05-04 14:17:03
How do I call this, please? I tried putting an email address in test_email_validation.php and ran that and got some html out..
I had hoped it would validate all email in emaildomainswhitelist.csv or something like that? several at a time? One at a time will work if that is the only option..
Excuse my ignorance, but I just don't see how to invoke this?
Manuel Lemos - 2020-05-04 15:06:16 - In reply to message 1 from Steven Tester
The test_email_validation.php script is a Web page that outputs the results of the validation of an email.
You can run it from a Web page so you can see the results.
First it will show you a link to validate a generic email. Click on that link. Then change in the URL bar of your browser the part that appears a test email address with the address you want to validate.
In your application just copy the PHP code that the test_email_validation.php and adapt the class variables to set any parameters that need to be changed.
Take a look at the comments in the script for more details and let me know if you have other questions.
Steven Tester - 2020-05-04 15:22:46 - In reply to message 2 from Manuel Lemos
Thank-you so much for your quick response!
I do not want to run it as a web page, I just want run it from Linux from the command line. Is this possible without many changes? I hope? Your script seems so comprehensive.
Ideally, just a yes/no output if the email is valid is all am looking for.
Manuel Lemos - 2020-05-04 15:42:26 - In reply to message 3 from Steven Tester
Yes, just take the test_email_validation.php script, remove the HTML output and the part that takes the parameter from the $_GET["email"] variable.
Instead take the email to validate from the $SERVER['argv'] variable which corresponds to the value of the first argument that you pass to the script from the Linux command line console.
Steven Tester - 2020-05-04 16:26:08 - In reply to message 4 from Manuel Lemos
I am so close! One issue: Unfortunately, I do not have email set-up on this server (I am just validating to_mail), so, I am getting:
C MAIL FROM: <[my not existing from_email]><br />
S 553 5.3.0 flpd571 DNSBL:RBL 521< [my ip] >_is_blocked.
Is there generic MAIL FROM address I can use, or can I comment out this check somewhere?
(I will also look to see - thank-you so much for your help:)
Manuel Lemos - 2020-05-04 18:37:48 - In reply to message 5 from Steven Tester
That error means that the IP address of the computer you are using to send email is blacklisted. That may happen if you are using a home based computer or a server in a low cost hosting company.
You need to use a server machine from which you are allowed to send email messages, as the class simulates the delivery of a real message.