Author Topic: Application Open Url Mailto  (Read 5253 times)


  • Playmaker Newbie
  • *
  • Posts: 13
Application Open Url Mailto
« on: June 17, 2014, 05:13:39 AM »

This is a modified version of Application Open Url, so that it will only generate a mailto link, with the option to add a Subject and Body text.
It will get rid of the formatting problems that sometimes happen when adding text to fields in Application.OpenURL

I tested only on iOS and the editor, but it should work in any platform where Application.OpenURL is supported.

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
[Tooltip("Open a Mailto Url link in the browser or email client")]
public class ApplicationOpenUrlMailto : FsmStateAction

[Tooltip("Email Address")]
public FsmString inputEmail;

public FsmString inputSubject;

public FsmString inputBody;

public override void OnEnter()

string email = inputEmail.Value;
string theSubject = inputSubject.Value;
string theBody = inputBody.Value;

string subject = MyEscapeURL(theSubject);
string body = MyEscapeURL(theBody);

Application.OpenURL("mailto:" + email + "?subject=" + subject + "&body=" + body);


string MyEscapeURL (string url)
return WWW.EscapeURL(url).Replace("+","%20");

I hope someone else finds it useful.


  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 21
Re: Application Open Url Mailto
« Reply #1 on: May 06, 2020, 11:02:01 PM »
This is really old, but should be added to the EcoSystem- with the small update to UnityWebRequest instead of WWW.  Very nice and saved me issues with formatting for mobile.


  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Application Open Url Mailto
« Reply #2 on: May 26, 2020, 02:42:20 AM »

WWW usage here would still be valid right? it's only to escape chars. or do you hit problem with that?