PHP Classes

type UTF-8 character in "From_name" part

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  type UTF-8 character in "From_name" part  >  (Un) Subscribe thread alerts  
Subject:type UTF-8 character in "From_name" part
Summary:i set $from_name variable whit persian language e.g "ح&#
Messages:2
Author:hassan
Date:2011-06-11 07:17:01
Update:2011-06-11 07:43:51
 

  1. type UTF-8 character in "From_name" part   Reply   Report abuse  
Picture of hassan hassan - 2011-06-11 07:17:01
i set $from_name variable whit persian language (UTF-8 encoding) but when i open email it not showed correctly like this:
(حسن to hansarifar )
please help me how can i type UTF-8 character for $from_name
tanks in advance
best regards

  2. Re: type UTF-8 character in "From_name" part   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-06-11 07:43:52 - In reply to message 1 from hassan
E-mail headers need to use q-encoding to encoded non-ASCII characters. That is not a trivial issue.

The MIME message can take care of that encoding and it can work together with the SMTP class. Just set the default_charset of the MIME message class object to 'utf-8' and it will encode all message header values properly.

phpclasses.org/mimemessage