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;