Jump to content

E-mail domain block in Customer Service


ThisSmart

Recommended Posts


 

Good afternoon! I want to make sure that no e-mails come for example with the domain example.com in Customer Service

I do that in ContactController.php:

$domain_name_block = 'example.com';
			$domain_name_email = substr(strrchr($from, "@"), 1);
			if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from) || $domain_name_block == $domain_name_email ) {
        		$this->errors[] = Tools::displayError('Invalid email address.');

This doesn't work! What is wrong in code or there is another way?

Edited by ThisSmart (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...