title: Php Emails Character Codification
body: <p>i'm using the following code to send e-mails from php. </p>
  
  <pre><code>    $to = 'myemail@domain.com'; 
  $subject = 'Test email with attachment'; 
  $random_hash = md5(date('r', time())); 
  $headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com"; 
  $headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""; 
  if(isset($_FILES['curriculum_vitae']['name']) &amp;&amp; $_FILES['curriculum_vitae']['name'] != ''){ $attachment = chunk_split(base64_encode(file_get_contents($_FILES['curriculum_vitae']['tmp_name']))); }
  ob_start();
  ?&gt; 
  --PHP-mixed-&lt;?php echo $random_hash; ?&gt;  
  Content-Type: multipart/alternative; boundary="PHP-alt-&lt;?php echo $random_hash; ?&gt;" 
  
  --PHP-alt-&lt;?php echo $random_hash; ?&gt;  
  Content-Type: text/plain; charset="iso-8859-1" 
  Content-Transfer-Encoding: 7bit
  
  Hello World!!! 
  This is simple text email message. 
  
  --PHP-alt-&lt;?php echo $random_hash; ?&gt;  
  Content-Type: text/html; charset="iso-8859-1" 
  Content-Transfer-Encoding: 7bit
  
  &lt;h2&gt;Hello World!&lt;/h2&gt; 
  &lt;p&gt;This is something with &lt;b&gt;HTML&lt;/b&gt; formatting.&lt;/p&gt; 
  
  --PHP-alt-&lt;?php echo $random_hash; ?&gt;-- 
  
  &lt;?php if(isset($_FILES['curriculum_vitae']['name']) &amp;&amp; $_FILES['curriculum_vitae']['name'] != ''){ ?&gt;--PHP-mixed-&lt;?php echo $random_hash; ?&gt;  
  Content-Type: application/zip; name="&lt;?php echo $_FILES['curriculum_vitae']['name']; ?&gt;"  
  Content-Transfer-Encoding: base64  
  Content-Disposition: attachment  
  
  &lt;?php echo $attachment; ?&gt; 
  --PHP-mixed-&lt;?php echo $random_hash; ?&gt;--
  &lt;?php } ?&gt;
  &lt;?php 
  $message = ob_get_clean(); 
  $mail_sent = @mail( $to, $subject, $message, $headers ); 
  echo $mail_sent ? "Mail sent" : "Mail failed"; 
  </code></pre>
  
  <p>However, when i receive the email on the webmail i have problems with the character codification. Characters like "à" or "ç" appears in strange forms. </p>
  
  <p>Is this a problem of the codification i have defined in the code above?</p>
  
  <p>Thanks!</p>