![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
In one of my pages the user will receive a confirmation email which thanks him / her for her input. Problem is that this page is made in another language (Persian font) and when I get my test emails they all look like
???? ?? ?????? ?? ????? ?????? in the php pages everything works fine becasue I save them as UTF-8 can this be somehow added to email? In onther work fot gets lost. The code I am using for email is shown bellow. What should I add to this to solve this problem? Thanks in adavnce if($Email !="") { $Emaill = $Email; $subject = "آگهی شما دریافت شده و ظرف چند ساعت دیگر مطالعه و به ب سایت اضافه می شود. این کپی شماست"; $additionn ="FROM: 123@123.com"; $message = "شماره آگهی شما \"".$RecID."\". عنوان: ".$Title."\". ایمیل:".$Email."\". آدرس:".$Address."\". شخص مسئول تماس:".$Contact."\". متن آگهی:".$ADTEXT."\""; @mail ("$Emaill","$subject","$message","$additionn"); }
__________________
^c^ |
|
|
|
|
|
#2 |
|
King of Portal
|
Re: Mail sent by PHP
Take a look at the php functions utf8_encode and utf8_decode. If not it may be an error with your mail viewer program or the smtp server which sends the mail. Try putting the results into a binary file which you can then view independently of your browser.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
Re: Mail sent by PHP
Thank you for your suggestion. I tried it I am still getting exactly what I copy bellow:
This is eactly how the raw data looks in the tables in MySQL altough when they come to the PHP pages they look fine in the correct font. I thinkt the data is there we are missing some translation. Does this ring any bells? Ú?Ù^Ù? درخÙ^است ارساÙ" Ù?سخÙ? Ø®Ù"اصÙ? شدÙ? Ù^ Ú©Ù"Ù.Ù? رÙ.ز Ø¢Ú¯Ù?ÛO شارÙ? "40 here is a copy of the information:". عÙ?Ù^اÙ?: Ù^ÛOÙ"ا دربابÙ"سر کراÛOÙ? تÙ.اÙ. تابستاÙ?". گرÙ^Ù?:Ù.عاÙ.Ù"ات Ù.Ù"Ú©ÛO-براÛO کراÛOÙ?". Ú©Ù"Ù.Ù? رÙ.ز براÛO تغÛOÛOر: 1234". تÙ"ÙÙ?: 311-321-88111-0". اÛOÙ.ÛOÙ":123@123.com". آدرس:". شخص Ù.سئÙ^Ù":Ø¢Ù,اÛO جÙ.اÙ"ÛO". Ù.تÙ? Ø¢Ú¯Ù?ÛO:Ù^ÛOÙ"ا دربابÙ"سر کراÛOÙ? تÙ.اÙ. تابستاÙ? Ù^ÛOÙ"ا دربابÙ"سر کراÛOÙ? تÙ.اÙ. تابستاÙ? Ù^ÛOÙ"ا دربابÙ"سر کراÛOÙ? تÙ.اÙ. تابستاÙ?" Ø�*اÙ"ا Ù.ÛO تÙ^اÙ?ÛOد بÙ? ØµÙØ�*Ù? Ù.راجعÙ? Ú©Ù?ÛOد Ù^ با اÛOÙ? Ú©Ù"Ù.Ù? رÙ.ز Ø¢Ú¯Ù?ÛO تاÙ? را تغÛOÛOر دÙ?ÛOد.
__________________
^c^ Last edited by Logical1; Jun 2nd, 2008 at 11:25 PM. |
|
|
|
|
|
#4 |
|
King of Portal
|
Re: Mail sent by PHP
All I can think of is that whatever font your viewer might be using doesn't have a Persian unicode set.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
Additional info
I did a lot of tests.
I can get emails with Persian or arabic fornts witout any problems but when sending them to myself as a test Outlook express gives me option of sending them as UNICODE or not. If they are Unicode then I can view them witout any problem. So problem must be how to send an email using PHP with UNICODE. It must have something to do with information in the header. So far I have not been able to find anything on it. If you can find anything let me know. Thanks a bunch in advance L1
__________________
^c^ |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
Re: Mail sent by PHP
You need to encode the email message in order to send it. In PHP this is done with the mbstring extension, so make sure you have that, then use the mb_send_mail function instead of the regular mail one
http://us3.php.net/mb_send_mail how to setup mbstring and then send mail - http://www.advogato.org/article/812.html
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
tx
Thank you I was stuck for days trying to figure out this simple thing.
__________________
^c^ |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP problem | zanatos | PHP | 3 | Apr 12th, 2008 12:09 AM |
| New PHP Based Forum-RPG | dizdain | Paid Job Offers | 5 | Dec 3rd, 2007 2:32 AM |
| google mail vs yahoo mail | hoffmandirt | Coder's Corner Lounge | 23 | Sep 7th, 2006 2:22 PM |
| Php Tutorial 3 | bulio | PHP | 4 | Jul 16th, 2006 4:00 AM |
| Php Tutorial 1 | bulio | PHP | 17 | May 29th, 2006 4:54 AM |