- Home /
Sending Mobile Email via Unity
Is there a way to send email on a mobile device via Unity?
@ina You should also check this out Opening URL and send Email from Unity
For complex actions, Cross Platform Native Plugins allows option to send nicely formatted HT$$anonymous$$L body and attachments. This plugin is free to use.
Answer by Twayne · May 10, 2011 at 02:10 PM
Application.OpenURL("mailto:yesyoucan@hotmail.com?subject=Email&body=from Unity");
I have not tried to attach a file from the users device to email out.
Won't this just open a new mail message on your device? You can just add files to the message as you usually would when sending a new mail. If your device can send attachments at all... If the file is a local file or on the same network your device is on, you can use something like: "mailto:yesyoucan@hotmail.com?subject=Email&body=from Unity&attachment=\"\\myhost\myfolder\myfile.png\"" If the file is on some site - you're out of luck.
"mailto:yesyoucan@hotmail.com?subject=Email&body=from Unity&attachment="\myhostmyfoldermyfile.png""
Sending emails with attacement didnt work for me, it simply wont open the email client. However removing the " from the file url does cause the client to open, but with no file attached..
Answer by Cyb3rManiak · May 11, 2011 at 08:43 AM
Unity support plugins. Check out the section about iOS and Android. If you can write a plugin that sends an email message, you can use it from inside Unity.
Also, if it's acceptable with you, you can have a server somewhere that creates and sends out emails, and from your Unity application you connect to it using the WWW class, or the WWWForm class (just like there are websites out there where you can fill out a form - and the site will send the information you entered as an email message). The mail won't exactly be sent from your mobile device, but from the server.
Your answer
Follow this Question
Related Questions
Application.OpenURL for email on mobile 4 Answers
Joystick trouble... 0 Answers
Optimal # of Faces for many mesh scene for mobile 1 Answer
How to have my mobile device screen lighting on all the time 2 Answers
Slow Startup on iOS and Android 1 Answer