Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Japanese email encoding sending issue Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
raindm
Groupie
Groupie
Avatar

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 13 December 2009 at 5:27am | IP Logged Quote raindm

Hello

I am trying to send a Japanese email..
The content shows correctly..
but the Subject and from email name looks like this: "振込みで全"
You might see this correctly here, but it looks like numbers and &# ..special characters i believe.


I am using         & nbsp;    objMailer.Message.Charset = "utf-8"; before populating the content/email subject/ from name

Should i use other encoding? is there any other solution i should know of?

Thank you,
Dror
Back to Top View raindm's Profile Search for other posts by raindm
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 14 December 2009 at 1:54am | IP Logged Quote Igor

We suggest using MailMessage.EncodeAllHeaders method. For the 2nd parameter, specifying HeaderEncodingOptions.None (which means using default Quoted-Printable encoding) should be fine in most cases.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
raindm
Groupie
Groupie
Avatar

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 15 December 2009 at 6:14am | IP Logged Quote raindm

Hi

i tried this and it still shows me the the strange like ಪ characters in the subject.

I read this http://stackoverflow.com/questions/419977/japanese-email-sub ject-encoding

but even after trying the suggestions i couldn't make it work correctly..
i even tried:   smtp.Subject = "=?ISO-2022-JP?B?" + emailData.Subject + "?=";
which shows some Japanese character but not like the original i wanted to send..

If you have any workaround this i would greatly appreciate it.
Back to Top View raindm's Profile Search for other posts by raindm
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 15 December 2009 at 6:39am | IP Logged Quote Alex

First of all, how do you know the Japanese text is correct when you place it into .Subject property? I.e. how do you know the text wasn't ruined earlier?

Also, how does it appear the body (in contrast to headers) is rendered properly? Do you use HTML encoding there (so that Japanese characters appear as &# sequences there)?

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
raindm
Groupie
Groupie
Avatar

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 16 December 2009 at 1:33am | IP Logged Quote raindm

Hi Alex

I know how the original Japanese text looks like So when i send it by email it looks different with strange characters also so i know it changed. If i take the &# and copy paste it into google it translate it to the correctly Japanese characters so i know it is correct.


In the body it does have &# sequence for Japanese character however it is rendered correctly. (We use HTML body)
Just the subject and From Email Name doesn't render correctly.

I read that-
"Also, your subject line should not exceed 75 characters per line. That is, 75 characters after you've encoded in ISO-2022-JP and base64"

It seems that when doing :
" smtp.Message.EncodeAllHeaders(Encoding.UTF8, HeaderEncodingOptions.Base64);"

It doesn't change the &# to Base64 which might be the issue here..

I looks at Japanese email i received from other source and it seems the subject is Base64, in my case it doesn't convert the &# to Base64.
This is just something i suspect, but i am not sure it is the issue.

Thank you,
Dror


Back to Top View raindm's Profile Search for other posts by raindm
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 December 2009 at 5:53am | IP Logged Quote Igor

If you have Japanese characters encoded with &#..., that's not actually text but HTML encoding, it cannot be converted, and cannot be normally displayed in message subject. You should supply plaintext (not HTML-encoded) Japanese characters and encode them using EncodeAllHeaders method.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
raindm
Groupie
Groupie
Avatar

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 16 December 2009 at 7:27am | IP Logged Quote raindm

Hi Igor,

It seems that the information is save with HTML encoding into my database (mssql)

Is there a way to decode the characters?



Back to Top View raindm's Profile Search for other posts by raindm
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 December 2009 at 7:54am | IP Logged Quote Igor

Try using HttpUtility.HtmlDecode method for this.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
seraulu1
Newbie
Newbie
Avatar

Joined: 12 February 2010
Location: United States
Online Status: Offline
Posts: 1
Posted: 12 February 2010 at 11:01pm | IP Logged Quote seraulu1

Good suggestion thanks for that
Back to Top View seraulu1's Profile Search for other posts by seraulu1
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide