  /*Adresa prijimatela*/
  $address_to = 'your@mail.sk';
  
  /*Predpona predmetu*/
  $subject_prepend = 'Predpona - ';
  
  /*Text pred*/
  $your_name = '&laquo; Vae meno';
  $your_email = '&laquo; V e-mail';
  $your_subject = '&laquo; Predmet';
  $your_email_content = 'Obsah e-mailu:';
  
  /*Text zobrazeny v poliach, ktore po kliknuti zmyznu*/
  $initial_name_string = 'Your Name';
  $initial_email_string = 'your@email.com';
  $initial_subject_string = 'Subject';
  
  /*Text tlacidiel*/
  $button_send = 'Poslat e-mail';
  $button_reset = 'Vymazat';
  
  $info_send = '<p>Prosm neklikajte na "Posla&#357; e-mail" viac ako jeden-krt.</p>';
  $email_error = '<p class="error"><b>Zadajte prosm sprvny mail a sprvne opte text z obrzka!</b></p>';
  $email_charset = 'utf-8';
  
  /*Rozmery poli*/
  $name_width = '';
  $email_width = '';
  $subject_width = '';
  $text_cols = '';
  $text_rows = '';
  
  /*Sprava po odoslani e-mailu*/
  $email_sent_msg = '<b>&#270;akujem za V e-mail!</b>' . "\n";
  $email_sent_msg .= "<p>V e-mail bol spene odoslan! Odpoviem na&#328;ho &#269;o najskr ako bude mon.</p>" . "\n";
  
  
  /* ------------------------------------------------------*/
  /* Don't mess with this unless you know what ur doing!!! */
  /* This is the actual code...                            */
  /* ------------------------------------------------------*/
  
  
  $mail_form = '';
  $mail_form .= '<form action="" method="post" id="contact_me">' . " \n ";
  $mail_form .= '<input type="text" name="name" id="name"';
  
  
  
  if (isset($_POST['name'])) {
      $mail_form .= " value=\"" . $_POST['name'] . "\"";
  } else {
      $mail_form .= ' value="' . $initial_name_string . '"';
  }
  
  if (!isset($_POST['name'])) {
      $mail_form .= " onclick=\"document.forms[0].name.value=''\" ";
  }
  
  $mail_form .= 'size="' . $name_width . '" />' . " \n";
  $mail_form .= '<label for="name">' . $your_name . '</label><br />' . " \n ";
  $mail_form .= '<input type="text" name="email" id="email" ';
  
  if (isset($_POST['email'])) {
      $mail_form .= "value=\"" . $_POST['email'] . "\" ";
  } else {
      $mail_form .= 'value="' . $initial_email_string . '" ';
  }
  if (!isset($_POST['email'])) {
      $mail_form .= "onclick=\"document.forms[0].email.value=''\" ";
  }
  
  $mail_form .= 'size="' . $email_width . '" />' . "\n";
  $mail_form .= '<label for="email">' . $your_email . '</label><br />' . " \n";
  $mail_form .= '<input type="text" name="subject" id="subject" ';
  
  if (isset($_POST['subject'])) {
      $mail_form .= "value=\"" . $_POST['subject'] . "\" ";
  } else {
      $mail_form .= 'value="' . $initial_subject_string . '" ';
  }
  
  if (!isset($_POST['subject'])) {
      $mail_form .= "onclick=\"document.forms[0].subject.value=''\" ";
  }
  $mail_form .= 'size="' . $subject_width . '" /' . "\n";
  $mail_form .= '<label for="subject"> ' . $your_subject . '</label><br />' . "\n";
  $mail_form .= $etomite->getCaptchaCode() . "<br />\n";
  $mail_form .= "<input type=\"text\" id=\"captcha\" name=\"captcha\" value=\"\" /> &laquo; Bezpenostn kd (<em>zadajte presne a odzadu!</em>)<br />";
  $mail_form .= '<label for="content_text">' . $your_email_content . '</label><br />' . "\n";
  $mail_form .= '<textarea name="content_text" id="content_text" rows="' . $text_rows . '" cols="' . $text_cols . '">';
  
  if (isset($_POST['content_text'])) {
      $mail_form .= $_POST['content_text'];
  }
  $mail_form .= '</textarea><br />' . "\n";
  $mail_form .= '<input type="hidden" name="send_email" value="sent" />' . "\n";
  $mail_form .= '<input class="button" type="submit" value="' . $button_send . '" /> <input class="button" type="reset" value="' . $button_reset . '" />' . "\n";
  $mail_form .= '</form>' . "\n";
  $mail_form .= $info_send;
  
  
  if (isset($_POST['send_email']) && $_POST['send_email'] == 'sent') {
      /* check e-mail variable, output errors, then send the e-mail + thank you message */
      
      
      /* take a given email address and split it into the
       username and domain. */
      
      list($userName, $mailDomain) = split("@", $_POST['email']);
      if (checkdnsrr($mailDomain, "MX") && $etomite->validCaptchaCode(strrev($_POST['captcha']))) {
          // this is a valid email domain! -> send the mail and say thanks!
          
          $name = $_POST['name'];
          $email = $_POST['email'];
          $subject = "$subject_prepend" . $_POST['subject'];
          $content_text = $_POST['content_text'];
          $content_texts = "<!--\nName:    " . $name . "\nE-mail:  " . $email . "\nSubject: " . $_POST['subject'] . "\nIP:      " . $_SERVER['REMOTE_ADDR'] . "\nDate:    " . date('m.d.Y H:m:s') . "\n-->\n\nContent:\n--------\n\n  " . $content_text . "\n\n--\nFrom Etomite Mail Form";
          $message = base64_encode($content_texts);
          
          $headers = "MIME-Version: 1.0\n";
          $headers .= "Content-Type: text/plaint; charset=\"" . $email_charset . "\"\n";
          $headers .= "Content-Transfer-Encoding: base64\n";
          $headers .= "From: " . $name . " <" . $email . ">\n";
          $headers .= "Reply-To: " . $name . " <" . $email . ">\n";
          $subject = "=?utf-8?B?" . base64_encode($subject) . "?=";
          
          mail($address_to, $subject, $message, $headers);
          
          $output = '';
          $output .= $email_sent_msg;
          return $output;
      } else {
          /* return an error and add the form */
          $output = '';
          $output .= $email_error;
          $output .= $mail_form;
          return $output;
      }
  } else {
      /* return an html e-mail form */
      $output = '';
      $output .= $mail_form;
      return $output;
  }
