Hi,
I'm trying to send an HTML email, which includes an image, and contains some portuguese language specific characters, using phpmailer.
My code looks like this:
require_once('phpmailer_v2.3/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = EMAIL_USERNAME; // SMTP username
$mail->Password = EMAIL_PASSWORD; // SMTP password
$mail->From = EMAIL_FROM;
$mail->FromName = EMAIL_FROMNAME;
$mail->AddAddress($email);
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->CharSet = "utf-8";
$mail->AddEmbeddedImage('myimg.png','myimg','myimg.png');
$MailBody = '<HTML><BODY><IMG SRC="cid:myimg><br><br>'.$EmailTextPT.
"<br><br><br>".EMAIL_FOOTER."</BODY></HTML>";
$mail->Subject = utf8_encode(EMAIL_SUBJECT);
$mail->Body = utf8_encode($MailBody);
$result = $mail->Send();
$EmailTextPT contains some text with Portuguese characters. The email subject also contains some Portuguese characters.
The email is sent but when I open it in gmail it's not recognized as an html email (the body is displayed as plain text with the html tags "showing" and the image is received as an attachment). When I open the email in mac os x email client, I only see the subject and the image, but the text is absent.
What am I doing wrong?
Thanks in advance,
Pedro