title: sending email by using json
body: <p>i am trying to send email and the code working fine 
  this part should be the reply after clicking on submit but when i click submit it 
  this is what appears </p>
  
  <pre><code>{"nameMessage":"","emailMessage":"","messageMessage":""} 
  </code></pre>
  
  <p>this is the part that is not working properly </p>
  
  <pre><code>var postdata = $('.contact-form form').serialize();
      $.ajax({
          type: 'POST',
          url: 'sendmail.php',
          data: postdata,
          dataType: 'json',
          success: function(json) {
              if(json.nameMessage != '') {
                  $('.contact-form form .nameLabel').append(' - &lt;span class="violet" style="font-size: 13px; font-style: italic"&gt; ' + json.nameMessage + '&lt;/span&gt;');
              }
              if(json.emailMessage != '') {
                  $('.contact-form form .emailLabel').append(' - &lt;span class="violet" style="font-size: 13px; font-style: italic"&gt; ' + json.emailMessage + '&lt;/span&gt;');
              }
              if(json.messageMessage != '') {
                  $('.contact-form form .messageLabel').append(' - &lt;span class="violet" style="font-size: 13px; font-style: italic"&gt; ' + json.messageMessage + '&lt;/span&gt;');
              }
              if(json.nameMessage == '' &amp;&amp; json.emailMessage == '' &amp;&amp; json.messageMessage == '') {
                  $('.contact-form form').fadeOut('fast', function() {
                      $('.contact-form').append('&lt;p&gt;&lt;span class="violet"&gt;Thanks for contacting us!&lt;/span&gt; We will get back to you very soon.&lt;/p&gt;');
                  });
              }
          }
      });
      return false;
  });
  });
  </code></pre>