Results 1 to 7 of 7

Thread: checkbox for mail copy

  1. #1
    Senior Member Thomas Frei-Herrmann's Avatar
    Join Date
    Apr 2010
    Location
    Berlin, Germany
    Posts
    1,000

    Default checkbox for mail copy

    I have countless enquiries concerning the contact forms (like "FormsHandler" component) how I established this checkbox at my form where the user can tick it to receive a copy of his mail which he just has sent. 97 of 100 users are ticking this box because they want a copy of what they have written.

    Maybe this could be considered.
    Tommy

    Administrator at the German NOF-Forum

    NOF-Tutorials.com | German NOF-Forum | Overview of my tutorials | Facebook

  2. #2
    Senior Member Adendum's Avatar
    Join Date
    Apr 2010
    Location
    London (UK) & Granada (Spain)
    Posts
    926

    Default

    Thomas,

    Yes, I like that idea!

    Can it be done in NOF as it stands now?
    Paul - Aditerum Ltd and AllSortsOfStuff Ltd
    NOF11 (in Admin mode!); Vista Premium 64bit; AMD Phenom IIx4 945 Processor 3.00Ghz; 8.0Gb RAM
    Wouldn't it be great if there was only a single browser to worry about!!!

  3. #3
    Senior Member Thomas Frei-Herrmann's Avatar
    Join Date
    Apr 2010
    Location
    Berlin, Germany
    Posts
    1,000

    Default

    .. here you can try:

    http://www.tommyherrmanndesign.com/nof/html/kontakt.php

    just tick checkbox (name of checkbox: "sendMail" (variable "$sendUser") with value "JA") "Kopie meiner Nachricht an mich senden" (you also may switch Google translator at the bottom of my page to English)


    please be aware that I am a "newbie" with php but here is what I have changed in NOF file:

    fh_formshandler.php

    ... important is to find out which position ($mzaehler) which CSV-field has (from left to right), i.e. lastname (variable $lastName) is position 2 and city (variable $city) is position 5 etc, etc, depending on the fields of your form.

    I also display the information of the users name and city, date, time an so on at my "success page".

    What I did is marked with // EDIT Thomas

    ... in my case CSV-field "sendMail" is the last field in my csv-file


    Code:
                      // EDIT Thomas ANFANG //////////////////////////////////////////////////////////////////////////////
                      $firstName = preprocess($entryAppend);                                        // = Feld Vorname   //
                      } else {
                            $mzaehler++;                        // eigene Variable $mzaehler in der Schleife hochzählen //
    
                            $entry = $entry . "," .  preprocess($entryAppend);
    
                            // EDIT Thomas ///////////////////////////////////////////////////////////////////////////////
                         
                            if ($mzaehler == "2") {                                                 // wenn Feld 2      //
                               $lastName = preprocess($entryAppend);                                // = Feld Nachname  //
                            }
                            if ($mzaehler == "5") {                                                 // wenn Feld 5      //
                               $city = preprocess($entryAppend);                                    // = Feld Stadt     //
                            }
                            if ($mzaehler == "8") {                                                 // wenn Feld 7      //
                               $mail = preprocess($entryAppend);                                    // = Feld e-Mail    //
                            }
                            if ($mzaehler == "9") {                                                 // wenn Feld 9      //
                               $comment = preprocess($entryAppend);                                 // = Feld Kommentar //
                            }
                            if ($mzaehler == "10") {                                                // wenn Feld 10     //
                               $reply = preprocess($entryAppend);                                   // = Feld Auswahl   //
                            }
                            $sendUser = preprocess($entryAppend);                                   // = Feld sendMail  //
                            // EDIT Thomas ENDE //////////////////////////////////////////////////////////////////////////
                      }
                }
          }
    
          // EDIT Thomas Anfang - Variable Übergabe an Ausgabedatei //////////////////////////////////////////////////////
          $timestamp = time();                                                  // Variable gründen mit aktueller Zeit  //
          $datum = date("d.m.Y",$timestamp);                                    // Variable gründen mit aktuellem Datum //
          $uhrzeit = date("H:i",$timestamp);                                    // Format festlegen                     //
          $_SESSION['$datum'] = $datum;                                         // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$uhrzeit'] = $uhrzeit;                                     // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$firstNameK'] = str_replace( "\"", "", $firstName );       // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$lastNameK'] = str_replace( "\"", "", $lastName );         // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$cityK'] = str_replace( "\"", "", $city );                 // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$mailK'] = str_replace( "\"", "", $mail );                 // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$comment'] = str_replace( "\"", "", $comment );            // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$reply'] = str_replace( "\"", "", $reply );                // Variable-Übergabe an Ausgabescript   //
          $_SESSION['$sendUser'] = str_replace( "\"", "", $sendUser );          // Variable-Übergabe an Ausgabescript   //
          $_SESSION['mkontakt'] = "Formular";                                   // Variable setzen   für Ausgabescript  //
          $_SESSION['userkontakt'] = "Formular";                                // Variable setzen   für Ausgabescript  //
          // EDIT Thomas ENDE ////////////////////////////////////////////////////////////////////////////////////////////
    I have set my "success page" of my forms handler component to "php" and have included this mail form (below, I have not changed my German text now). All SESSION variables have been declared in NOF file "fh_formshandler.php" in advance (see above)


    Code:
    <?php
          // mail to sender
          // e-mail Addres of sender
          $sendAbs = $_SESSION['$mailK'];
          // subject of e-Mail
          $sendThema = "Kopie Deiner Nachricht an Thomas Frei-Herrmann wegen NOF";
    
          // Text of e-Mail to sender
          $sendUser  = "Hallo,\r\n\r\n";
          $sendUser .= $_SESSION['$firstNameK'] . " " . $_SESSION['$lastNameK'] . " aus " . $_SESSION['$cityK'] . ".\r\n\r\n\r\n";
          $sendUser .= "Vielen Dank für Deine Nachricht. Ich werde so schnell wie möglich antworten.\r\n\r\n";
          $sendUser .= "Du hast folgende Nachricht an mich gesendet:\r\n\r\n";
          $sendSign  = "\r\n\r\n\r\n\r\nGruss Thomas";
    
          
          if ($_SESSION['$sendUser'] == "JA") {                         // IF User wants a copy of his mail and he ticked checkbox
             //e-Mail senden an Absender
             $mail_sent = @mail( $sendAbs, $sendThema, $sendUser . $sendComment . $sendSign, "From: mail@YourDomain.com"); 
             echo $mail_sent ? "a copy has been sent:" : "Mail delivery failed:"; 
             echo "<br><br>";
             echo "<b>" . $sendAbs . "</b>";
          }
          
    ?>
    have fun
    Last edited by Thomas Frei-Herrmann; 08-31-2010 at 12:52 PM.
    Tommy

    Administrator at the German NOF-Forum

    NOF-Tutorials.com | German NOF-Forum | Overview of my tutorials | Facebook

  4. #4
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Not wanting to rain on anyone's parade, but the risk of having a "Copy Me" function is that your form could become a spam gateway.

    For example, I go to Thomas' site, fill in "my" email as "paul-at-addendumb-dot-com, and fill in my message as: "Enlarge you c1gar at this www....".

    Bingo. Spam to Paul via the "copy me". Then a robo-script to repeatedly fill in the form with a list of target emails, and ...

    I use the Tectite form mailer script, and it will only allow echoing form information if you use full CAPTCHA in order to protect people from themselves.
    Ray Cambpell
    Sounds In Sync
    Linked in

  5. #5
    Senior Member Thomas Frei-Herrmann's Avatar
    Join Date
    Apr 2010
    Location
    Berlin, Germany
    Posts
    1,000

    Default

    ...any NOF form is (unfortunately) like this too

    CAPTCHA is a joke - not more

    Maybe this one is a bit better - but also not save...

    http://www.tommyherrmanndesign.com/n...ml/skript.html
    Last edited by Thomas Frei-Herrmann; 08-31-2010 at 05:59 PM.
    Tommy

    Administrator at the German NOF-Forum

    NOF-Tutorials.com | German NOF-Forum | Overview of my tutorials | Facebook

  6. #6
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Not wanting to derail this, but the discussion may provide more fodder for improvements to NOF...

    When I set up my formmailler for a site recently, I used "Reverse CAPTCHA" (sometimes called a "honeypot"). The technique used 2 additional fields with random names. The first had a text field with a random text string pre-entered in it, and the second had a text field that was blank. Finally, they were both made invisible on the form.

    The theory goes, if the data in either of these fields is changed when the form is submitted, the form is most likely being filled in by a BOT, and is flagged as such. The "live" user doesn't see the fields and has nothing extra to do.
    Ray Cambpell
    Sounds In Sync
    Linked in

  7. #7

    Default

    Thank you so much for sharing this info which I definitely share with others on this OG WhatsApp application...

Posting Permissions

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