This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Submissions to Email with + sign


  1. akash8m
    Member

    Some users have Gmail with the following:

    Example+123@gmail.com even though it is sent to Example@gmail.com.

    Is it possible to have this input in the MachForm? Also, I would like to use this method when receiving the form submissions. Thanks.

    Posted 14 years ago #
  2. redityo

    You can change the validation for this. Edit "email_settings.php" file and go to around line 101 for this code :

    $regex  = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/';

    and change it to

    $regex  = '/^[\+]*[A-z0-9][\+\/\w.-]*@[A-z0-9][\w\-\.]*\.[A-z0-9]{2,6}$/';

    for users input, you can edit "includes/common-validator.php" and go to line 210 for this code :

    $regex  = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]*\.[A-z0-9]{2,6}$/';

    and change it to

    $regex  = '/^[\+]*[A-z0-9][\+\/\w.-]*@[A-z0-9][\w\-\.]*\.[A-z0-9]{2,6}$/';

    that would do it


    MachForm Support

    Posted 14 years ago #
  3. akash8m
    Member

    Thanks Redityo for this solution. Cheers.

    Posted 14 years ago #
  4. akash8m
    Member

    Hello Redityo, I changed according to your instructions, the user input works fine without any problems, but the Email_settings.php solution is not working still gives the same error.

    "This field is not in the correct email format."

    The new codes seem to be the same for both is that the problem?

    Posted 14 years ago #
  5. akash8m
    Member

    Redityo, I fixed it, there were two occurrences of $regex in email_settings.php. When I changed both with the new codes it works fine. Thanks again for the help. Great service.

    Posted 14 years ago #

RSS feed for this topic

Reply