+ Reply to Thread
Results 1 to 4 of 4

Thread: Trying to undertand correct settings for $TARGET_EMAIL

  1. #1
    Join Date
    Apr 2007
    Posts
    4

    Question Trying to undertand correct settings for $TARGET_EMAIL

    1) If I make the minimum changes to formmail.php and set '$TARGET_EMAIL = array(EMAIL_NAME."@mydomain\.com$");' and
    2) on the form set '<input type="hidden" name="recipients" value="myname@hotmail.com" />',
    I get 'Error=The form has an internal error - no valid recipients were specified.' in the message sent to my DEF_ALERT email address. I presume this is because 'hotmail' is not defined in the $TARGET_EMAIL array. This is what I might expect from the documentation.

    However, with no changes to $TARGET_EMAIL described in (1) above
    a) if I have a formmail.ini with "me=myname@hotmail.com" NOT DEFINED in it, then I get the "no valid recipients" message sent to my DEF_ALERT email address, as before, but
    b) if I have a formmail.ini with "me=myname@hotmail.com" DEFINED in it, then the message goes through fine.

    There are warnings in the documentation on setting $TARGET_EMAIL very carefully to avoid "relaying", but in this case, the presence of the "myname@hotmail.com" address in the .ini file seems to allow mail to be sent to that address without any further chanfes to $TARGET_EMAIL, i.e, formmail.php appears to scan the .ini file to see if the address is present there, and send the message if the address is found.

    Is this a correct interpretation of how things work?

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Trying to undertand correct settings for $TARGET_EMAIL

    Hi,

    That's exactly right.

    Some versions ago, if you had an email address in the INI file, you would also have to allow that email address in $TARGET_EMAIL.

    However, that was extra redundant work. Since the INI file is on the server, it's just as secure from the web as FormMail itself.

    Therefore, recent versions of FormMail automatically accept email addresses in the INI file as being safe to send to.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Trying to undertand correct settings for $TARGET_EMAIL

    Hi again,

    BTW, this is mentioned in the HOW TO guide for INI files:
    http://www.tectite.com/fmhowto/inifile.php

    See the section titled "Email addresses".
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Apr 2007
    Posts
    4

    Default Re: Trying to understand correct settings for $TARGET_EMAIL

    Thanks for the confirmation, and the pointer to the relevant section in the page on .ini files. I would suggest it would be appropriate to include a note in the documentation page on $TARGET_EMAIL saying that the presence of email addresses in a .ini file removes the requirement to include them in the $TARGET_EMAIL setting. The link you gave me above could be added also.
    Formmail looks to be a very nice piece of software.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. multi-dimensional arrays in fields, how can I template that correct
    By pauloportu in forum FormMail Subscription Support
    Replies: 8
    Last Post: 27-Oct-2005, 07:47 AM
  2. Did I enter the settings correctly?
    By nc555 in forum FormMail Subscription Support
    Replies: 3
    Last Post: 11-Aug-2005, 01:07 PM
  3. limit on how many recipients can be listed in TARGET_EMAIL array?
    By nurblet in forum FormMail Subscription Support
    Replies: 8
    Last Post: 02-Aug-2005, 01:47 AM
  4. TARGET_EMAIL pattern error [M78]
    By marcquey in forum FormMail Subscription Support
    Replies: 4
    Last Post: 10-Jul-2005, 07:32 AM
  5. TARGET_EMAIL question
    By middleburyman in forum FormMail Subscription Support
    Replies: 1
    Last Post: 03-Sep-2004, 09:30 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