B4J Question Wrong Format Message Body In Email Server

Hello All
I use EmailServer for get new emails from email but message body will be in wrong format if the message is Persian.

The correct format should be like this :

But Message will be like this :

 

behnam_tr

Active Member
Licensed User
Longtime User
check this :

B4X:
dim su as stringutils
dim st as string
st = su.EncodeUrl(your string, "UTF8")
log(s)

lib : jstringutils
 
Upvote 0
I don't send the emails.
Actually somebody sends some emails to my gmail daily and i wanna download that emails and analyze them.
Also they contains Persian text.
Now What should I do?
 
Upvote 0
Don't use MailParser. What is the output of Log(Message) in DownloadCompleted event?


It's the MessageText in DownloadCompleted event
 
Upvote 0
I tested this and write it just after initializing the pop and before the pop.DownloadMessage(id, False) and in the DownloadCompleted event but it gave Error in every condition :

 
Last edited:
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
but message body will be in wrong format if the message is Persian.
Unfortunately, I do not speak the Persian language. That makes reading the text incomprehensible to me. What strikes me is that the involved email clients use all kinds of encrypting protocols. The site concerned appears to offer a variety of products. The text message may be encrypted. The question is what happens if you send a message to the email server yourself? If that is readable, your program is correct, but cannot read the encrypted message.
 
Upvote 0

Hello MicroDrie and thanks for your answer

I tested what you said and when I send my own persian text to email it will good in the email and its format doesn't change So I thought if I send the wrong format text to email it will convert to correct format but when i send , it didn't change and stayed in wrong format.

So according to your answer my program is correct and message (Not wrong format text) will be readable if i send it to email
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
jReflection can only work in a UI app. Try it with a UI project.

Dear Erel
I really thank you and don't know how to appreciate you.
Your code worked and Persian text is in correct format now.
Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…