- Home /
Can't send email from ios device when email body contains arabic characters!
Hello,
I want to send an email a string on an ios device. Here's the code:
 Application.OpenURL ("mailto: " + email + "?subject=" + subject + "&body=" + body);
when the body has arabic characters, the mail window does not even open! I tried displaying on the screen (using ngui label) and the text was printing on the screen.
Any hints please
This is a wild shot, but have you tried escaping the characters? Reference
@chufraise yes I have!, here's the code.. thanks anyway :)
     void SendEmail ()
     {
         string email = "";
         string subject = $$anonymous$$yEscapeURL("");
         string body = $$anonymous$$yEscapeURL("");
 
         for(int i = 0 ; i<HighScore$$anonymous$$anager._instance.GetHighScore().Count;i++)
         {
             body += (HighScore$$anonymous$$anager._instance.GetHighScore()[i].name +","+HighScore$$anonymous$$anager._instance.GetHighScore()[i].telephone +"," + HighScore$$anonymous$$anager._instance.GetHighScore()[i].score +"," + HighScore$$anonymous$$anager._instance.GetHighScore()[i].email +$$anonymous$$yEscapeURL("\n"));
         }
 
 
         tempLabel.GetComponent<UILabel>().text = body;
 
         Application.OpenURL("mailto:" + email + "?subject=" + subject + "&body=" + body);
     }
     
     string $$anonymous$$yEscapeURL (string url)
     {
         return WWW.EscapeURL(url).Replace("+","%20");
     }
Way ahead of me I see :)
Have you tried typing in a web dummy url with the same request params? Like:
 Application.OpenURL ("http://www.unity3d.com/?subject=" + subject + "&body=" + body);
Just to see if your web browser opens. If it doesn't maybe you can sniff the request using a proxy.
Just spitballin' here.
@chufraise again, same story.
everything going fine, and not when i have arabic charaters in the body. (window does not even open) .. strange
Sorry for taking you out on this wild goose chase. I take it you're testing this in the Unity editor, any clues from the unity log?
Also, have you tried outputing the resulting escaped url in the console, and then copy/pasting it to the browser to see what happens?
Answer by NgenGames · Apr 30, 2018 at 09:28 AM
having the same issue did you got any solution to this? if yes plz share
Answer by hameed-ullah-jan · Apr 30, 2018 at 09:32 AM
Hello have got any solution to this, i have the same issue, can you share it plz
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                