| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Improved Email Address Validation | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Improved Email Address Validation
Probably one of the most important aspects of doing business online is the ability to ensure that a customer is kept well informed about the status of their order, whether that status may be that it shipped or it had to be backordered or that a credit card payment (for those that capture payment during shipment and not at time of sale) did not go through.
The issue that can arise however (and we experience this frequently) is the customer will often purposefully provide a fake email address or one with a disposable email service or even by accident provide an email address that is invalid due to typographical errors or the mailbox may be full. In order to combat this issue we re-wrote the func_check_email() procedure that comes with X-Cart to further enhance it's abilities. The reason for this is that the procedure only checks for syntax validity, not existence or validity of the mailbox itself. MODIFICATION REQUIREMENTS:
This modification is provided as-is with no guarantee or warranty. It is intended for advanced users only as patches are not provided and does not include an admin interface. It is assumed that any manual additions to the filter table will be done through a direct SQL console interface such as the MySQL Workbench, phpMyAdmin, PremiumSoft Navicat MySQL or MySQL CLI. ================================================== ====== STEP 1: The Email Validation SQL Table The first step is to add the SQL table that will be referenced by the functions func_check_email() and func_check_email_towerdata(). This is mainly intended as both a caching assistant and to handle permanently blacklisted usernames and domain names (as well as bad MX records). Code:
L - localpart or username D - domain name M - MX record (for people that use bad or fake MX records like mx.fakemx.net) There's also a field called filter_permanent which denotes 0 (false) or 1 (true) that the filter is a permanent one and should not be purged during frequent checks against the filter_expires field. Once you have that table created proceed to step 2. ================================================== ====== STEP 2: Modification of func_check_email() Now that we have the SQL table necessary to make this work created, it is time to re-write the func_check_email() function. Locate the function func_check_email() and replace the entire contents with the following: include/func/func.mail.php: PHP Code:
|
|||||||
|
#2
|
|||||||
|
|||||||
Re: Improved Email Address Validation
STEP 3: The creation of func_check_email_towerdata()
Now that you have finished modifying func_check_email() it is time to create the func_check_email_towerdata() function which will use TowerData's Email Validation Service (http://www.towerdata.com/services/web/email_validation.html) to validate the email address further. NOTE: You must have an account with TowerData for this to work and you must have the SOAP extension and PHP 5.2 or greater. Without any of these conditions met (they are not checked) you will break the entire func_check_email() function which breaks anything dependent on it. include/func/func.mail.php: PHP Code:
NOTE: By default the system will block failed domain names for 30 days and failed usernames for 15 days. You may tweak these to your desire but you should not go beyond 30 days for sanity reasons. Once you have fully tested this modification it should help reduce any problems you have from bad e-mails being used that can tie up mail servers or prevent communication. It is suggested you change the language variable txt_email_invalid to be more specific as to why the email address failed when they are attempting to register or use any part of the site that utilizes func_check_email(). Hopefully you will find this as useful as we have over the years. |
|||||||
|
#3
|
|||||||
|
|||||||
Re: Improved Email Address Validation
Will it work on 4.6.1?
__________________
x-cart Gold 4.4.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|