Hello! Made a small module for joomla 2.5, a simple form that sends an email to the mail.

// To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: www.maxicom.ru <info@maxicom.ru>' . "\r\n"; //Отправка сообщения mail("bogachov-webadvert@yandex.ru","Online заявка",$apply,$headers); 

A message is formed above the code ($ apply variable), the file is in UTF-8 encoding (without BOM). A letter arrives to normal mail normally, but in email clients, for example, thanderbird with an encoding trouble. Tell me what to do? Can some parameters be added to the headers, washes something else? Thank you in advance!

    2 answers 2

    Send to utf-8 encoding, do not forget to separately encode in utf-8 the subject of the letter (subject) and the name of the sender (From)

    otherwise, if the pismo is ok, then the subject of the letter and the name of the sender, if Russian letters are present there, will also be krakozyabrami.

    Better yet, instead of mail, use a class, for example, from PEAR there is a class Mail.

      I figured it out, copied the script without looking, here:

       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 

      It is necessary to specify the UTF-8 encoding and all the buzz. =)