received form submission with invalid email 2 years 7 months ago #242756

  • Topic Author
  • jjspelman
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 49
  • Thanks: 0
I just received a form submission from one of my forms and the email was

I realize the validation only checks syntax but this is not a valid syntax?

Please advise.

Please Log in or Create an account to join the conversation.

received form submission with invalid email 2 years 7 months ago #242768

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Administrator
  • Administrator
  • Super Users
  • Posts: 10398
  • Thanks: 839

".om" is actually a valid syntax but not valid in terms of semantics.

If you want it sort of bulletproof you need to create a validation that checks checks if the mailserver actually exists (MX DNS lookup) or create an ever-changing full list of TLDs.

We left that out because the latter can never complete and the first is not always working for every host (some hosting providers don't allow the use of PHP's checkdnsrr()):

- In you email field's validation, choose "custom"
- Copy the code below into the codebox and change FIELDNAME with the name (not title) of your email field:
function ff_FIELDNAME_validation(element, message)
        let valid_email = ff_validemail( element, message );
        let valid_mx = true;

        JQuery.ajax({                                         //starts the ajax request
            type: "POST",					//define method "GET" or "POST"
            url: '<?php return JURI::getInstance()->toString() ?>',    	//the PHP file to call for DB queries or other processing
            data: {check_email: element.value},		//values to pass to the PHP file
            async: false, // we need it instantly
            success: function(data){//success callback function starts here
                valid_mx = data.valid_mx;

        }); //ajax

        if (valid_email != ''  || !valid_mx) {
            if (message=='') message =" faild in my test.\n"
            return message;
        } // if
        return '';

- In form advanced => more options => form pieces => before form => click "custom"
- add the code below into the codebox:
if( JRequest::getVar('check_email', '') != '' ){

    if (ob_get_level()) ob_end_clean();
    while (ob_get_level()){

    $result = new stdClass();
    $array = explode("@",JRequest::getVar('check_email', ''));
    $domain = array_pop($array);
        $result->valid_mx = true;
    } else {
        $result->valid_mx = false;

    header('Content-Type: application/json');
    echo json_encode($result);

Save and close and try the email validation.

As reference, I also attached you a working form to this reply.
To try it out, please download, unzip and import it in BF => Configuration => Package Installer.

File Attachment:

File Name:
File Size:7 KB


Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.044 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

Quick Links










Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

Questions et réponses sur les forums de l'AFUJ


Subscribe to news and updates!

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!