Drupal coder

E-mail top level domain suffixes not incorporated in core e-mail validation function valid_email_address in Drupal

Using the Drupal core function valid_email_address($mail) doesn't cover all possible e-mail address syntax errors.

This function doesn't take the Top Level Domain in count. The explanation from the Drupal core developers is that they want to make e-mail addresses on a domain without a TLD, like root@localhost, valid.

So beware of this! This is spread all over the Drupal system. Even while registering on a Drupal website, you don't have to specify the TLD. So I think a lot of people will make the typo and register with an address like johndoe@hotmailcom and they will never receive their confirmation e-mail.

February 04, 2008Drupal

Comments

drupal unable to send email with to-level domain with country code like .com.ph

For future reference there actually is a patch ready for Drupal 6 that fixes some more cases. The behavior will be:

admin@localhost - valid
admin@elsewhere - valid
admin@localhost.com - valid
admin@localhost. - invalid
admin@ - invalid

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options