PHP Classes

Arabic html mail problem

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Arabic html mail problem  >  (Un) Subscribe thread alerts  
Subject:Arabic html mail problem
Summary:encode problem
Messages:15
Author:FREDJ A .J
Date:2011-08-04 02:19:36
Update:2011-08-05 18:41:44
 
  1 - 10   11 - 15  

  11. Re: Arabic html mail problem   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-08-04 19:31:49 - In reply to message 10 from FREDJ A .J
Please show your code, as I have no way to guess what you are doing wrong without seeing it.

  12. Re: Arabic html mail problem   Reply   Report abuse  
Picture of FREDJ A .J FREDJ A .J - 2011-08-05 01:26:53 - In reply to message 11 from Manuel Lemos
<?php
/*
* test_simple_html_mail_message.php
*
* @(#) $Header: /home/mlemos/cvsroot/mimemessage/test_simple_html_mail_message.php,v 1.1 2005/02/10 03:45:02 mlemos Exp $
*
*/
require("email_message.php");
/*
* Trying to guess your e-mail address.
* It is better that you change this line to your address explicitly.
* $from_address="me@mydomain.com";
* $from_name="My Name";
*/

/*
// "$RSS_ITEM_CONTENT" and "$RSS_ITEM_TITLE" come from "simplexml_load_file" func
$MSG = $RSS_ITEM_CONTENT;
$MSG_SUNJECT = $RSS_ITEM_TITLE;
$FROM = "xxxxxxxx@xxxxxxx.com";
$FROM_NAM = "FREDJ";
$TO_NAM = "FREDJ";
$TO = "xxxxxxxx@xxxxxxx.com";
*/
$from_address = $FROM;
$from_name = $FROM_NAM;

$reply_name = $from_name;
$reply_address = $from_address;
$reply_address = $from_address;
$error_delivery_name = $from_name;
$error_delivery_address = $from_address;
/*
* Change these lines or else you will be mailing the class author.
*/
$to_name = $TO_NAM;
$to_address = $TO;
//$to_address="mlemos@linux.local";
$subject = $MSG_SUNJECT;
$email_message = new email_message_class;
$email_message->SetEncodedEmailHeader("To", $to_address, $to_name);
$email_message->SetEncodedEmailHeader("From", $from_address, $from_name);
$email_message->SetEncodedEmailHeader("Reply-To", $reply_address, $reply_name);
$email_message->SetHeader("Sender", $from_address);
/*
* Set the Return-Path header to define the envelope sender address to which bounced messages are delivered.
* If you are using Windows, you need to use the smtp_message_class to set the return-path address.
*/
if (defined("PHP_OS") && strcmp(substr(PHP_OS, 0, 3), "WIN"))
$email_message->SetHeader("Return-Path", $error_delivery_address);

$email_message->SetEncodedHeader("Subject", $subject);

$html_message = $MSG;
$email_message->CreateQuotedPrintableHTMLPart($html_message, "", $html_part);
/*
* It is strongly recommended that when you send HTML messages,
* also provide an alternative text version of HTML page,
* even if it is just to say that the message is in HTML,
* because more and more people tend to delete HTML only
* messages assuming that HTML messages are spam.
*/
$text_message = "AST BLOG MSG";
$email_message->CreateQuotedPrintableTextPart($email_message->WrapText($text_message), "", $text_part);
/*
* Multiple alternative parts are gathered in multipart/alternative parts.
* It is important that the fanciest part, in this case the HTML part,
* is specified as the last part because that is the way that HTML capable
* mail programs will show that part and not the text version part.
*/
$alternative_parts = array(
$text_part,
$html_part
);
$email_message->AddAlternativeMultipart($alternative_parts);
/*
* The message is now ready to be assembled and sent.
* Notice that most of the functions used before this point may fail due to
* programming errors in your script. You may safely ignore any errors until
* the message is sent to not bloat your scripts with too much error checking.
*/
$error = $email_message->Send();
if (strcmp($error, "")) {
error_log("ERROR: $error\r\n", 3, "ERROR.FILE");
echo "Error: $error\n";
} else {
@include_once("LOG.php");
echo "True";
//echo mb_detect_encoding($subject);
}
?>

  13. Re: Arabic html mail problem   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-08-05 07:10:57 - In reply to message 12 from FREDJ A .J
You are not setting the character set anywhere, so it will use the default value which is iso-8859-1. You need to set at least the default_charset class variable to the the correct character set encoding.

  14. Re: Arabic html mail problem   Reply   Report abuse  
Picture of FREDJ A .J FREDJ A .J - 2011-08-05 17:58:41 - In reply to message 13 from Manuel Lemos
Actually i already did this in "email_message.php" var $default_charset="UTF-8";

as i told you before!

  15. Re: Arabic html mail problem   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-08-05 18:41:45 - In reply to message 14 from FREDJ A .J
If it is just the subject that does not come right, you need to make sure that the value that you are passing to the class is what you expect and it is in UTF-8 encoding.

 
  1 - 10   11 - 15