Skip to content

Instantly share code, notes, and snippets.

@DataGreed
Created March 9, 2019 21:08
Show Gist options
  • Save DataGreed/3600e5c30f2b04fb691245ee5e81d2ef to your computer and use it in GitHub Desktop.
Save DataGreed/3600e5c30f2b04fb691245ee5e81d2ef to your computer and use it in GitHub Desktop.
Unity Send Email (supports mobile)
using UnityEngine.Networking;
/// <summary>
/// Opens external application to send an email
/// </summary>
/// <param name="email">Email address</param>
/// <param name="subject">Subject.</param>
/// <param name="body">Body. E.g "My Body\r\nFull of non-escaped chars"</param>
void SendEmail(string email, string subject, string body)
{
Application.OpenURL("mailto:" + email + "?subject=" + subject + "&body=" + body);
}
string MyEscapeURL(string url)
{
return UnityWebRequest.EscapeURL(url).Replace("+", "%20");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment