title: Form in works with select multiple
body: <p>I developed a website where you will have a form where you will receive an email within this form exite 2 inputs select but the user will be able to select more than one option so I added the multiple tag so he can select more than one field when sending the form it works normally But he does not receive the other options of my select if I select more than one option in the email only one appears and the others do not, I would like to know how I can make the other options appear in the email follows the image of how it is displayed in the Email and codes. You can see in the site I selected more than one option and in the incoming email only one of them appears.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form class="form-budget" id="form-elements" onSubmit="return false"&gt;
                              &lt;div class="row"&gt;
                                  &lt;div class="col-md-12 center"&gt;
                                      &lt;div id="result"&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-6"&gt;
                                  &lt;input type="text" placeholder="Digite seu nome" name="name" id="name" required/&gt;
                                  &lt;input type="text" placeholder="Digite seu Email" name="email" id="email" required/&gt;
                                  &lt;input type="tel" placeholder="Digite seu Telefone" name="phone" id="phone" class="phone_with_ddd" required/&gt;
                                  &lt;input type="text" placeholder="Data do evento" name="date" id="date" class="date" required/&gt;
                              &lt;/div&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;select id="select-picker" class="selectpicker config" multiple
                                          name="config" id="config"
                                          data-selected-text-format="count &gt; 3" title="Configurações do evento"&gt;
                                      &lt;option value="Mesas-Cadeiras"&gt;Mesas e cadeiras&lt;/option&gt;
                                      &lt;option value="Auditório"&gt;Auditório&lt;/option&gt;
                                      &lt;option value="Lounge"&gt;Lounge&lt;/option&gt;
                                      &lt;option value="Galeria"&gt;Galeria&lt;/option&gt;
                                  &lt;/select&gt;
                                  &lt;input type="text" placeholder="Quantidade de pessoas" name="quant" id="quant" class="quant" required/&gt;
  
                                  &lt;select id="select-picker" class="selectpicker" multiple
                                          data-selected-text-format="count &gt; 3" title="Selecione os equipamentos"
                                          name="equip" id="equip" required&gt;
                                      &lt;option value="Projetor"&gt;Projetor&lt;/option&gt;
                                      &lt;option value="Som"&gt;Caixa de som&lt;/option&gt;
                                      &lt;option value="Flip-Chart"&gt;Flip-Chart&lt;/option&gt;
                                  &lt;/select&gt;
                                  &lt;button type="submit" class="btn btn-success" id="submit_btn"&gt;Enviar orçamento&lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>//Contact Us
  $("#submit_btn").click(function() {
      //get input field values
      var user_name       = $('input[name=name]').val();
      var user_email      = $('input[name=email]').val();
      var user_phone      = $('input[name=phone]').val();
      var user_date       = $('input[name=date]').val();
      var user_config     = $('select[name=config] option:selected').val();
      var user_quant      = $('input[name=quant]').val();
      var user_equip      = $('select[name=equip] option:selected').val();
      //var user_message    = $('textarea[name=message]').val();
  
      //simple validation at client's end
      var post_data, output;
      var proceed = true;
      if(user_name==""){
          proceed = false;
      }
      if(user_email==""){
          proceed = false;
      }
      if(user_phone=="") {
          proceed = false;
      }
  
      if(user_quant=="") {
          proceed = false;
      }
      if(user_date=="") {
          proceed = false;
      }
  
      //everything looks good! proceed...
      if(proceed)
      {
          //data to be sent to server
          post_data = {'userName':user_name, 'userEmail':user_email, 'userPhone':user_phone, 'userDate':user_date, 'userConfig':user_config, 'userQuant':user_quant, 'userEquip':user_equip};
  
          //Ajax post data to server
          $.post('contact.php', post_data, function(response){
  
              //load json data from server and output message
              if(response.type == 'error')
              {
                  output = '&lt;div class="alert-danger" style="padding:10px; margin-bottom:25px;"&gt;'+response.text+'&lt;/div&gt;';
              }else{
                  output = '&lt;div class="alert-success" style="padding:10px; margin-bottom:25px;"&gt;'+response.text+'&lt;/div&gt;';
  
                  //reset values in all input fields
                  $('#form-elements input').val('');
                  $('#form-elements textarea').val('');
              }
  
              $("#result").hide().html(output).slideDown();
          }, 'json');
  
      }
  });
  
  //reset previously set border colors and hide all message on .keyup()
  $("#form-elements input, #form-elements textarea").keyup(function() {
      $("#result").slideUp();
  });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  if($_POST)
  {
      $to_Email       = "teste@hotmail.com.br"; //Replace with recipient email address
      $subject        = 'Orçamento do site'; //Subject line for emails
  
  
      //check if its an ajax request, exit if not
      if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
  
          //exit script outputting json data
          $output = json_encode(
          array(
              'type'=&gt;'error',
              'text' =&gt; 'Request must come from Ajax'
          ));
  
          die($output);
      }
  
      //check $_POST vars are set, exit if any missing
      if(!isset($_POST["userName"]) || !isset($_POST["userEmail"]) || !isset($_POST["userPhone"]) || !isset($_POST["userDate"]) || !isset($_POST["userQuant"]))
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Os campos de entrada estão vazios!  '));
          die($output);
      }
  
      //Sanitize input data using PHP filter_var().
      $user_Name        = filter_var($_POST["userName"], FILTER_SANITIZE_STRING);
      $user_Email       = filter_var($_POST["userEmail"], FILTER_SANITIZE_EMAIL);
      $user_Phone =                  $_POST["userPhone"];
      $user_Date =                  $_POST["userDate"];
      $user_Config       = filter_var($_POST["userConfig"], FILTER_SANITIZE_EMAIL);
      $user_Quant =                  $_POST["userQuant"];
      $user_Equip       = filter_var($_POST["userEquip"], FILTER_SANITIZE_EMAIL);
      //$user_Message     = filter_var($_POST["userMessage"], FILTER_SANITIZE_STRING);
  
      //additional php validation
      if(strlen($user_Name)&lt;3) // If length is less than 3 it will throw an HTTP error.
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'O campo nome não pode ficar vazio'));
          die($output);
      }
      if(!filter_var($user_Email, FILTER_VALIDATE_EMAIL)) //email validation
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Por favor ultilize um e-mail válido'));
          die($output);
      }
  
      if(strlen($user_Phone)&lt;5) //check emtpy phone
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Por favor insira um número de telefone'));
          die($output);
      }
  
  
      if(strlen($user_Date)&lt;5) //check emtpy date
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Por favor insira uma data para o evento'));
          die($output);
      }
  
       if(strlen($user_Quant)&lt;2) //check emtpy date
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Por favor insira a quantidade de pessoas para o evento'));
          die($output);
      }
  
  
      $message_Body = "&lt;strong&gt;Name: &lt;/strong&gt;". $user_Name ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Email: &lt;/strong&gt;". $user_Email ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Phone: &lt;/strong&gt;". $user_Phone ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Data do Evento: &lt;/strong&gt;". $user_Date ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Quantidade de pessoas: &lt;/strong&gt;". $user_Quant ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Configurações do evento: &lt;/strong&gt;". $user_Config ."&lt;br&gt;";
      $message_Body .= "&lt;strong&gt;Equipamentos: &lt;/strong&gt;". $user_Equip ."&lt;br&gt;";
      //$message_Body .= "&lt;strong&gt;Message: &lt;/strong&gt;". $user_Message ."&lt;br&gt;";
  
  
  
      $headers = "From: " . strip_tags($user_Email) . "\r\n";
      $headers .= "Reply-To: ". strip_tags($user_Email) . "\r\n";
      $headers .= "MIME-Version: 1.0\r\n";
      $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
  
  
  
      //proceed with PHP email.
      $headers = 'From: '.$user_Email.'' . "\r\n" .
      'Reply-To: '.$user_Email.'' . "\r\n" .
      'X-Mailer: PHP/' . phpversion(). "\r\n" .
      'Content-type: text/html;charset=UTF-8';
  
  
  
      $sentMail = @mail($to_Email, $subject, $message_Body, $headers);
  
      if(!$sentMail)
      {
          $output = json_encode(array('type'=&gt;'error', 'text' =&gt; 'Ocorreu um erro tente novamente'));
          die($output);
      }else{
          $output = json_encode(array('type'=&gt;'message', 'text' =&gt; 'Olá '. $user_Name .' Obrigado pelo seu contato retornaremos em breve.'));
          die($output);
      }
  }
  ?&gt;
  </code></pre>