- Home /
Send HTML email to native email client
Application.OpenURL("mailto:" + email + "?subject:" + subject + "&body:" + body);
should open an email client, but url encoding doesnt work for an html body. Any ideas how to open up the native email client and send it an html body?
Just checking - you're trying to do this from a standalone application and not a webplayer or mobile app, correct?
sorry I should have mentioned that lol, From iOS, and hopefully android as well
Answer by Immanuel-Scholz · Jun 28, 2013 at 09:40 PM
I am not sure whether Application.OpenURL
works for iOS, but if your only problem is proper URL encoding, then use WWW.EscapeURL(body)
instead of body
;).
from my understanding, html doesnt translate using Application.OpenURL("mailto:"...
It would just create an email showing a plain text of the source
mh.. if the system does not accept fancy stuff in mailto: links *), then I guess you are out of luck. Nothing Unity can do here, right?
IIRC, Outlook doesn't accept anything "strange" in the subject line of mailto: links. And many mail clients throw away any body tag too. Don't know for iOS, sorry.
Not necessarily, Ive been making progress on an objective-C script that could be called from unity using the extern keyword. But its been tough since Im new to objective c so I was looking to see if anyone around here new of an easier solution.
Answer by Voxel-Busters · Aug 12, 2015 at 09:30 AM
There is no direct way to send html text. You need to use a plugin.
Cross Platform Native Plugins allows share via
E-Mail
SMS
Facebook
Twitter
Whats-App
It supports iOS and Android platforms with a unified interface.
You can send HTML text as body here. And the plugin is free to use for sharing feature.
Your answer
Follow this Question
Related Questions
Send email works in Editor, not on tablet 2 Answers
Send HTML email from iOS app 1 Answer
Unity iOS Android: open local HTML in Browser 1 Answer
Web based AR app 9 Answers