title: PHP emails from form scramble cyrillic characters
body: <p>Here's what this is all about. Since I am using PHP as of today I am facing this issue.
  I have build a form , for the ISP company that I work for, which emails the form results. Customers fill out this form to request new service from us. Since the company is foreign (Bulgarian) 99% of people are going to fill it out in Cyrillic , so I tested it by filling it out myself and I got this email.</p>
  
  <hr>
  
  <p>From: ÐÑÐ´ </p>
  
  <p>Phone number: 56 </p>
  
  <p>Selected Services: </p>
  
  <p>Internet: 100 || TV: comfort </p>
  
  <p>Message: </p>
  
  <p>ÐªÐ•ÐÐÐÐÐÐ  </p>
  
  <hr>
  
  <p>So I made some research , checked out a few other posts about this in StackOverflow but none worked... most suggested to add 
  <code>$header .= "\nContent-type: text/plain; charset=\"utf-8\"";</code></p>
  
  <p>One issue is that I'm not sure EXACTLY how to implement this solution, second is that it didn't work for the person who asked the question, not even in one of the questions I reviewed.</p>
  
  <p>Here is the PHP code and the HTML one, hoping you can give me an EXACT way of fixing it, since I have barely no idea of syntax in PHP.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Online Request&lt;/title&gt;
  &lt;meta content="php, contact, form, thinking" name="keywords"&gt;
  &lt;meta content="Contact us and let us know if we can help you out further." name="description"&gt;
  
  &lt;style&gt;
  input, textarea {
      color: #fff;
      padding: 5px;
      margin: 10px;
      font-family: Cambria, Cochin, serif;
      font-size: medium;
      font-weight: bold;
      outline: none;
  }
  p {
      font-family: Cambria, Cochin, serif;
      font-size: large;
      margin-bottom: -5px;
  }
  input[type=text], textarea {
      width: 350px;
      background-color: #000;
      border: 1px solid #000;
  }
  input[type=submit] {
      width: 100px;
      background-color: #710000;
      border: 1px solid #000;
      font-size: large;
      color: #FFFFFF;
  }
  input[type=submit]:hover {
      background-color: #990000;
      cursor: pointer;
  }
  input[type=submit]:active {
      background-color: #4A6F00;
  }
  
  h1 {
    text-size: 26px;
    font-family: Arial;
    text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
    color: #ff0000;}
  body {
      padding: 10px;
      background-color: #F4F4F4;
  }
  .checkbox {
    font-family: Cambria, Cochin, serif;
    font-size: large;
    margin-bottom: -5px;
  }
  &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;Online Request&lt;/h1&gt;
      &lt;form action="emailer.php" method="POST" accept-charset="UTF-8"&gt;
          &lt;div&gt;
              &lt;p&gt;Имена&lt;/p&gt;
              &lt;input name="name" type="text"&gt; &lt;br&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;p&gt;Телефон за връзка&lt;/p&gt;
              &lt;input type="text" name="number" min="10" max="10"&gt;
              &lt;br&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;p&gt; Вид услуга - Internet &lt;/p&gt; &lt;br/&gt;
              &lt;input name="servicetypeINT" type="radio" value="30"&gt;&lt;span class="checkbox"&gt; Internet Value - 30Mpbs &lt;/span&gt; &lt;br/&gt;
              &lt;input name="servicetypeINT" type="radio" value="60"&gt;&lt;span class="checkbox"&gt; Internet Mania - 60 Mbps &lt;/span&gt;&lt;br/&gt;
              &lt;input name="servicetypeINT" type="radio" value="100"&gt;&lt;span class="checkbox"&gt; Internet Extreme - 100Mbps&lt;/span&gt; &lt;br/&gt;
              &lt;input name="servicetypeINT" type="radio" value="150"&gt;&lt;span class="checkbox"&gt; Internet Pro - 150Mpbs&lt;/span&gt;&lt;br/&gt;
          &lt;/div&gt;
          &lt;hr/&gt;
          &lt;div&gt;
              &lt;p&gt;Вид услуга - Телевизия&lt;/p&gt; &lt;br/&gt;
              &lt;input name="servicetypeTV" type="radio" value="anal"&gt;&lt;span class="checkbox"&gt; Аналогова телевизия - 50 канала &lt;/span&gt; &lt;br/&gt;
              &lt;input name="servicetypeTV" type="radio" value="start"&gt;&lt;span class="checkbox"&gt; Start TV - 40+ Цифрови канала &lt;/span&gt;&lt;br/&gt;
              &lt;input name="servicetypeTV" type="radio" value="comfort"&gt;&lt;span class="checkbox"&gt; Confort TV - 160+ Цифрови канала&lt;/span&gt; &lt;br/&gt;
              &lt;input name="servicetypeTV" type="radio" value="mania"&gt;&lt;span class="checkbox"&gt; Mania TV - 160+ Цифрови / 20+ HD канала&lt;/span&gt;&lt;br/&gt;
          &lt;/div&gt;
              &lt;div&gt;
              &lt;p&gt;Comment&lt;/p&gt;
              &lt;textarea cols="30" name="comment" rows="9"&gt;&lt;/textarea&gt;
              &lt;br&gt; &lt;/div&gt;
          &lt;div&gt;
          &lt;input name="submit" type="submit" value="Изпрати"&gt; &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  
  
  &lt;?php
  
  if(isset($_POST['submit'])) {
  $to = "denislav@svishtov.net";
  $subject = "New Internet and/or TV request";
  
  // data the visitor provided
  $name_field = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
  $phone_field = filter_var($_POST['number']);
  $selectedINT_field = filter_var($_POST['servicetypeINT']);
  $selectedTV_field = filter_var($_POST['servicetypeTV']);
  $comment = filter_var($_POST['comment'], FILTER_SANITIZE_STRING);
  
  
  //constructing the message
  $body = "
  From: $name_field\n\n
  Phone number: $phone_field\n\n
  Selected Services:\n\nInternet: $selectedINT_field || TV: $selectedTV_field \n\n
  Message:\n\n $comment ";
  
  // ...and away we go!
  mail($to, $subject, $body);
  
  // redirect to confirmation
  header('Location: confirmation.html');
  } else {
  // handle the error somehow
  echo "Грешка в попълването на формата";
  }
  ?&gt;
  </code></pre>
  
  <p>Another interesting fact is that when I opened the file from my local machine (since if I try from the one hosted online, I will get the error echo) the Cyrillic text in the php code itself was displayed just like the email result... 
  But when I opened it from the host , by directly addressing it I got the error message right... in Bulgarian... without any gibberish.</p>
  
  <p>The line of code in the PHP</p>
  
  <pre><code>header('Content-Type: text/html; charset=utf-8');
  </code></pre>
  
  <p>seemed to convert the header message. I tried addressing <code>$name_field('Content-Type: text/html; charset=utf-8');</code></p>
  
  <p>But result was <em>blank</em>, the php didn't function properly, I'm guessing since I gave it a wrong or inoperable line of code with that addressing of <code>$name_field</code>.</p>
  
  <p>Question is, how do I address it properly and I'm I even on the right track with this approach?</p>