PHPMailer-FE charset - accented characters missing in mailbox

Hi - would very much appreciate some suggestions re:

using PHPMailer-FE on a site -

PHPMailer-FE is really good, however I've hit a snag... when messages sent via the mailform arrive in the destination mailbox(es), not only are the accented characters, such è,ò,à, missing but the string in which they are contained are also completely missing - the form entry just not there! When I then send another message with regular characters... no problem. So, the mailform's working ok, but not handling the accented characters.

 mailbox screenshot
I've changed the meta tag on the php page in which the mailform appears, and also found the appropriate parts of code in phpmailer-fe.php...4th line from last in this code snippet...

function mail_it($content, $subject, $email, $realname, $recipient, $inbound=true) {
  global $attachment_chunk, $attachment_name, $attachment_type, $attachment_temp;
  global $local_chunk, $local_name, $local_type, $local_temp;
  global $bcc, $cc;
  global $PHPMailerLocation, $PHPMailerLiteLocation;
  global $fixedFromEmail, $fixedFromName, $text_only, $htmlCharset;

  if ($realname) {
    $sendTo = $realname . "<" . $email . ">";
  } else {
    $sendTo = $email;
  $ob = "----=_OuterBoundary_000";
  $ib = "----=_InnerBoundery_001";

  $mail_headers  = "MIME-Version: 1.0\r\n";
  if ($fixedFromEmail != '') {
    $mail_headers .= "From: " . $fixedFromEmail . "\n";
  } else {
    $mail_headers .= "From: " . $sendTo . "\n";
  $mail_headers .= "To: " . $recipient . "\n";
  $mail_headers .= "Reply-To: " . $sendTo . "\n";
  if ($cc)  { $mail_headers .= "Cc: ".$cc."\n"; }
  if ($bcc) { $mail_headers .= "Bcc: ".$bcc."\n"; }
  $mail_headers .= "X-Priority: 1\n";
  $mail_headers .= "X-Mailer: PHPMailer-FE v" . VERSION . " (software by\n";
  $mail_headers .= "Content-Type: multipart/mixed;\n\tboundary=\"" . $ob . "\"\n";
  $mail_message  = "This is a multi-part message in MIME format.\n";
  $mail_message .= "\n--".$ob."\n";
  $mail_message .= "Content-Type: multipart/alternative;\n\tboundary=\"" . $ib . "\"\n\n";
  $mail_message .= "\n--" . $ib . "\n";
  $mail_message .= "Content-Type: text/plain;\n\tcharset=\"" . $htmlCharset . "\"\n";
  $mail_message .= "Content-Transfer-Encoding: quoted-printable\n\n";
  $mail_message .= $content["text"] . "\n\n";
  $mail_message .= "\n--" . $ib . "--\n";

Open in new window

$htmlCharset is previously defined in phpmailer-fe.php in this line...

 * Used as the charset for HTML emails
 * default is "iso-8859-1"
 * @var string
 * NOTE: Required here, change as needed
$htmlCharset    = "iso-8859-1";

Open in new window

So, as can be seen, the default charset should be fine for the accented characters in question. I have, however, tried changing it to other charset specs but to no avail.

The problem appears in mailboxes on:

my local mailclient (thunderbird 3.1.6 on W7),
namesco webmail, (
aruba webmail, (http:/ webmail

2 of these are italian based for chrissake! Ok Scott...breathe...

I've also submitted a support ticket with namesco (who are generally brilliant!..and where the site is hosted) to ask if there could be anything happening their end, but I'll need to wait til tmrw for a response...

So, there it is - any ideas? Thanks in advance...


 mailbox screenshot
Who is Participating?
scottieclarkConnect With a Mentor Author Commented:
after taking the time to post a question with as much detail as possible, inc. screenshots etc. I'm pretty disappointed with ONE response of 1 line and 6 lines of code, especially when the complexity of the code I'm trying to work with makes it obvious that no-one has even bothered to look closely at the question. I'm paying for what?...
Try adding in before the message is sent:
$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);

Open in new window

Taken from:
scottieclarkAuthor Commented:
disappointed. could be my fault if i've posted without following some esoteric protocol but for a second post since signing up i can't imagine it was so bad!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.