1

I'm using this class to send emails: PHP Mailer

The email content is "Ciao, lui è Marco" for example. When I send the email to the receiver, He will read only "Ciao, lui ". It seems that the message will break when it encounter special characters. How can i resolve this problem?

This is my code:

if($testo != "" && $oggetto != "")
{
    $counter = 0;
    $res = $conn->query("SELECT *  FROM iscritti_newsletter WHERE newsletter_attiva = 1;");

    $arraycolonne = $miscMGR->GetTableColumns("iscritti_newsletter");
    while($row = $res->fetch_array(MYSQLI_ASSOC))
    {
        $testotmp = $testo;
        $mail = "";
        foreach($arraycolonne as $colonna)
        {
            $testotmp = str_replace("[$colonna]", $row[$colonna], $testotmp);
            if($colonna == "email")
                $mail = $row[$colonna];
        }
        if($mail != "")
        {
            $mailMGR = new mail_manager();
            $mailMGR->sendMail($mail, $testotmp, $oggetto);
            $counter++;
        }
    }
    $msg .= "$counter email sent! <br>";
}
echo $msg;
BigElle
  • 97
  • 1
  • 8
  • There seems to be an answer to the PHP Mailer encoding issue here http://stackoverflow.com/questions/2491475/phpmailer-character-encoding-issues – Christofer Ohlsson Jan 18 '16 at 08:01
  • I tried to do the utf8_encode on the message: Not working I tried $mailMGR->CharSet = 'UTF-8' : Not working I tried $mailMGR->Encoding = "base64" : Not woking :( – BigElle Jan 18 '16 at 08:10

0 Answers0