Problems, need help? Have a tip or advice? Post it here.
16 posts Page 2 of 2
Could you please try sending the same email using the phpMailer addon (viewtopic.php?p=22911#p22911)?

Please let me know if the problem persists.
KK thank you for your concern :)

I want to tell you that the problem with Cyrillic characters in the php mail forms is very very very common.

Last night I tried 10 forms, and all have a problem with email subject.
But I found a solution and I ask you to help, the question is can we apply it.
Here Broken PHP form:

Code: Select all
    $to = 'orb@abv.bg';   
   $subject  = "Относно на кирилица";
   $headers  = 'MIME-Version: 1.0' . "\r\n";
   $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
      
   $headers .= 'From: fastmedia <support@support.com>' . "\r\n";
   
   $email_body = "
   <table width=\"500\" height=\"186\" border=\"0\" align=\"left\">
   
   <tr>
      <td colspan=\"3\" style=\"font-size:14px;font-family:Verdana,sans-serif;background-color:#cc0000;color:#FFFFFF\" align=\"left\"><strong>&#160;&#x272E; Текст на кирилица !&#160;&#x272E;&#160;</strong>
      </td>
   </tr>

   <td style=\"font-size:14px;font-family:Verdana,sans-serif;color:#ffcc00\" align=\"left\">&#160;&#x272E;</td>   
   </table>";

   $message = "
   <html>
   <head><title></title></head>
   <body><center>".stripslashes($email_body)."</center></body>
   </html>";
   /*mail($to,$subject,$message,$headers);*/
   mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers);


Here are working PHP form:

Code: Select all
    $to = 'orb@abv.bg';   
   $subject  = "Относно на кирилица";
   $headers  = 'MIME-Version: 1.0' . "\r\n";
   $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
      
   $headers .= 'From: fastmedia <support@support.com>' . "\r\n";
   
   $email_body = "
   <table width=\"500\" height=\"186\" border=\"0\" align=\"left\">
   
   <tr>
      <td colspan=\"3\" style=\"font-size:14px;font-family:Verdana,sans-serif;background-color:#cc0000;color:#FFFFFF\" align=\"left\"><strong>&#160;&#x272E; Текст на кирилица !&#160;&#x272E;&#160;</strong>
      </td>
   </tr>

   <td style=\"font-size:14px;font-family:Verdana,sans-serif;color:#ffcc00\" align=\"left\">&#160;&#x272E;</td>   
   </table>";

   $message = "
   <html>
   <head><title></title></head>
   <body><center>".stripslashes($email_body)."</center></body>
   </html>";



       /*wrong:*/
   /*mail($to,$subject,$message,$headers);*/
       /*correct:*/
   mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers);
Thanks @orbital. I can see the problem now.

However, I'd still request you to please try out the phpmailer addon I mentioned earlier.
I think it has this kind of subject encoding inbuilt.

Could you please do this for me?
Thanks.
Yes!!! KK :) :) :)
I installed phpmailer in $cfg['method'] = 'mail'; method (Send messages using PHP's mail() function) and everything is fine in gmail, yahoo and all others who are remembered.

But I have some changes in my functions.php file, can you tell me which part of the code is new to keep my changes?

Thank you very much!

PS
Today I bought my seventh COUCH license and am very happy :D :D :D :D
Thanks for supporting Couch by getting the license :)

Regarding the encoding problem, I'm glad that is resolved now.

As for the modified functions.php file, I think it'd be better if you simply download Couch's installation zip, extract the functions.php file from that and replace the modified one with the pristine version (I'm sure you are using v1.4.7, right? )
yes 1.4.7
16 posts Page 2 of 2
cron