DtyCFx
DtyCFx

Reputation: 61

Magento invalid email address

I'm trying to add my email address in Store Email Address, But it is saying "Invalid email address "admin@mydomain"." Note that my tld is uncommon. I think that is the reason for the error message. I can add .com email address easily btw.

Is there any way to add the email?

Thank you.

Upvotes: 1

Views: 5379

Answers (2)

szilike
szilike

Reputation: 16

I had the same issue, but your suggestions were misleading. The error message comes up not from this java script, but app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php

The error is generated from lib/Zend/Validate/EmailAddress.php, because it calls hostname verification from Hostname.php in the same directory. There you can find in row nr. 117 an array called $_validTlds there put your domain ('works' or in my case 'wien'), take care alphabetical order, and quotes and commas. save and try again, it will work. Good luck.

Upvotes: 0

Oscprofessionals
Oscprofessionals

Reputation: 2174

in validation.js you have ['validate-email', 'Please enter a valid email address. For example [email protected].', function (v) {

            return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
        }], 

You will have to play with this regular expression.

if you look into this expression you will find a . jsut remove every thing excluding ] from . till end and should solve.

Upvotes: 1

Related Questions