1

How to encode $subject with utf-8. When mail is send subject is Потврда On my local server it's ok. But not on online host.

$to = $_POST['email'];
            $subject = "Потврда за регистрација";
            $body = "<p>Вие сте регистрирани.</p>
            <p>За да го активирате вашиот акаунт, ве молиме кликнете на линкот <a href='".DIR."activate.php?x=$id&y=$activasion'>".DIR."activate.php?x=$id&y=$activasion</a></p>
            <p>Со почит, ваш Админ.</p>";

            $mail = new Mail();
            $mail->setFrom(SITEEMAIL);
            $mail->addAddress($to);
            $mail->subject($subject);
            $mail->body($body);
            $mail->send();


            header('Location: index.php?action=joined');
            exit;
Andry Jhonas
  • 379
  • 2
  • 13
  • This is already answered here http://stackoverflow.com/questions/17064510/utf-8-encoding-for-subject-in-contact-form-email – Pradeep Sambandam Jan 26 '16 at 21:08
  • worth a try `$subject = '=?utf-8?B?'.base64_encode("Потврда за регистрација").'?=';` –  Jan 26 '16 at 21:10

0 Answers0