Skip to content

Instantly share code, notes, and snippets.

@loschke
Last active February 8, 2020 11:01
Show Gist options
  • Select an option

  • Save loschke/425ad9a1711cd611711844523c2aea84 to your computer and use it in GitHub Desktop.

Select an option

Save loschke/425ad9a1711cd611711844523c2aea84 to your computer and use it in GitHub Desktop.

Revisions

  1. Rico revised this gist Feb 8, 2020. No changes.
  2. Rico renamed this gist Feb 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Rico renamed this gist Feb 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Rico revised this gist Feb 8, 2020. No changes.
  5. Rico revised this gist Feb 3, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion formmailer
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    // Ausführen wenn Formular gesendet
    if (isset($_POST["submit"]))
    {
    @@ -22,4 +23,5 @@ Nachricht: $nachrichtn

    // Verschicken der Mail
    mail($an, $betreff, $message, $mail_header );
    };
    };
    ?>
  6. Rico created this gist Feb 3, 2020.
    11 changes: 11 additions & 0 deletions form
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <form id="form" action="form2email.php" method="post">
    <label for="name">Name</label>
    <input id="name" name="name" size="25" type="text" />
    <label for="email">Email</label>
    <input id="email" name="email" size="25" type="text" />
    <label for="betreff">Betreff</label>
    <input id="betreff" name="betreff" size="25" type="text" />
    <label for="nachricht">Nachricht</label>
    <textarea id="nachricht" cols="50" rows="6" name="nachricht"></textarea>
    <input id="submit" name="submit" type="submit" value="Formular senden" />
    </form>
    25 changes: 25 additions & 0 deletions formmailer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    // Ausführen wenn Formular gesendet
    if (isset($_POST["submit"]))
    {

    // Sammeln der Formulardaten
    $an = "meine@email.de";
    $name = $_POST['name'];
    $email = $_POST['email'];
    $betreff = $_POST['betreff'];
    $nachricht = $_POST['nachricht'];

    // Mailheader UTF-8 fähig machen
    $mail_header = 'From:' . $email . "n";
    $mail_header .= 'Content-type: text/plain; charset=UTF-8' . "rn";

    // Nachrichtenlayout erstellen
    $message = "
    Name: $namen
    Email: $emailn
    Nachricht: $nachrichtn
    ";

    // Verschicken der Mail
    mail($an, $betreff, $message, $mail_header );
    };