Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Email Conditions Reject Emails with Hyphen

  1. #1
    Join Date
    Sep 2006
    Posts
    3

    Default Email Conditions Reject Emails with Hyphen

    Hi,

    I've just realized that the conditions I am using for requiring a valid email have been rejecting email address with hyphens (name@my-site.com).

    The code I am using came from http://www.tectite.com/vbforums/show...81&postcount=6

    Code:
    <input type="hidden" name="conditions" value=":#
     #TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #
     Please enter a valid email address.#" />
    Any ideas how to accept a hyphen?

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Email Conditions Reject Emails with Hyphen

    this should work:
    Code:
    #TEST#email ~ /^[-a-z0-9_.]+@[-a-z0-9_]+\.([-a-z0-9_.]+)*[-a-z0-9_.]$/i #

  3. #3
    Join Date
    Sep 2006
    Posts
    3

    Default Re: Email Conditions Reject Emails with Hyphen

    Quote Originally Posted by crabtree
    this should work:
    Code:
    #TEST#email ~ /^[-a-z0-9_.]+@[-a-z0-9_]+\.([-a-z0-9_.]+)*[-a-z0-9_.]$/i #
    Thank you for the reply, but I think that is the same exact code I have. Anyhow, I tried it on the page, and I'm still getting an error when I enter an email with a hyphen.

  4. #4
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Email Conditions Reject Emails with Hyphen

    hi

    currently I can't test anything, so maybe have look over there:
    http://tectite.com/vbforums/showthread.php?t=1053

    btw crabtree's code is not the same, there's "-" at the beginning everywhere

    not sure, perhaps try some different versions, i.e.:
    Code:
    <input type="hidden" name="conditions1" value=":##TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_-]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#" />
    (there's a "-" added to the first [..] after @)
    ...

  5. #5
    Join Date
    Sep 2006
    Posts
    3

    Default Re: Email Conditions Reject Emails with Hyphen

    Well using crabtree's code (it was different, asket, thanks for pointing that out) I was able to get it to work.

    I had to, for whatever reason, remove a '$' from the end of my email address on formmail.php to get it to function. It seems like everything is running smoothly at the moment.

    Thanks!

  6. #6
    Join Date
    Jul 2008
    Posts
    1

    Default Re: Email Conditions Reject Emails with Hyphen

    Hi,

    I have a similar situation, I defined fix email addresses for sending, and so happen this company domain name has a hyphen which is causing sending failure. This is my code in the formmail.php. been trying for a day to fix but still stuck. Please help, thanks! I can receive to my gmail but not the one with hyphen.

    /* Help: http://www.tectite.com/fmdoc/email_name.php */
    define("EMAIL_NAME","^[-a-z0-9.-]+"); // the '^' is an important security feature!

    /* Help: http://www.tectite.com/fmdoc/target_email.php */
    $TARGET_EMAIL = array("^mhaxxx@mxxf-txx\.com$","^ngxxxxx@gmail\.com$");

    /* Help: http://www.tectite.com/fmdoc/def_alert.php */
    define("DEF_ALERT","");

  7. #7
    Join Date
    Jul 2008
    Posts
    48

    Default Re: Email Conditions Reject Emails with Hyphen

    Hi,

    I have the same problem. I am using the latest version of FormMail and thought web addresses with a hyphen was not common. I hope there is an answer soon.

    Regards

    Drachsi

  8. #8
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Email Conditions Reject Emails with Hyphen

    Hi,

    The following works for me with a domain that has a hyphen in it:

    Code:
    define("EMAIL_NAME","^[-a-z0-9.]+");
    (Note it doesn't have the dash that you have after the 9.)

    ginger

  9. #9
    Join Date
    Jul 2008
    Posts
    48

    Unhappy Re: Email Conditions Reject Emails with Hyphen

    Hi,

    I am afraid it still does not work. I have in my form
    <input type="hidden" name="recipients" value="xxxxKTBZCGVWperob.com,xxxKTBZCGVWgasthof-oberried.de,xxxxxxKTBZCGVWperob.com" />

    and in MailForm:

    $TARGET_EMAIL = array(EMAIL_NAME."@perob\.com$",
    "^xxxx@perob\.com$",
    "^xxx@gasthof-oberried\.de$",
    "^xxxxxx@perob\.com$");

    The 2 to Perob work, and the one to Oberried does not.

    Your help and support are really appreciated.

    Regards

    Drachsi

  10. #10
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Email Conditions Reject Emails with Hyphen

    I don't really know what the problem is, but I guess I'd test by trying the individual email address. If that works, then you know the problem isn't with the hyphen and you can go from there:

    Code:
    $TARGET_EMAIL = array("^xxx@gasthof-oberried\.de$");
    Also, I don't understand why you have:
    Code:
    array(EMAIL_NAME."@perob\.com$"
    . . . and then have

    Code:
    ^xxxxxx@perob\.com$);
    The first one covers all email addresses at perob.com so you don't need to specify the inidividual email address.

    ginger
    Last edited by ginger23; 22-Jul-2008 at 04:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. sending me two emails
    By srolls in forum FormMail Subscription Support
    Replies: 2
    Last Post: 20-Sep-2004, 11:15 PM
  2. no emails being sent
    By dunn123 in forum FormMail Subscription Support
    Replies: 1
    Last Post: 13-Sep-2004, 12:19 PM
  3. Help with mail_options and conditions
    By wufpack00 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 06-Jul-2004, 12:49 AM
  4. only two emails every ten minutes?
    By vynsane in forum FormMail Subscription Support
    Replies: 4
    Last Post: 26-May-2004, 09:00 PM
  5. not receiving emails
    By ctpiper in forum FormMail Subscription Support
    Replies: 1
    Last Post: 22-Apr-2004, 09:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •