- Home /
Question by
samidr8 · Jan 26, 2019 at 03:45 AM ·
url schemes
I can not link the mail application script on the smartphone with Application.OpenURL
Hi, I have not managed to link the script called "SendMail" with a 3D Object, so that when I touch the 3D object, open the mail.
The steps I took were:
1) the 3D Object embed it to the ImageTarget.
2) I created a "Box Collider" in the 3D object
3) I created a scritp in the 3D obj named "SendMail" with the attached code.
Until there I arrived. I appreciate your help.
Attached script for review.
using UnityEngine;
using System.Collections;
public class SendMail : MonoBehaviour
{
public void EmailUs()
{
//email Id to send the mail to
string email = "samidr8@gmail.com";
//subject of the mail
string subject = MyEscapeURL("FEEDBACK/SUGGESTION");
//body of the mail which consists of Device Model and its Operating System
string body = MyEscapeURL("Please Enter your message here\n\n\n\n" +
"________" +
"\n\nPlease Do Not Modify This\n\n" +
"Model: " + SystemInfo.deviceModel + "\n\n" +
"OS: " + SystemInfo.operatingSystem + "\n\n" +
"________");
//Open the Default Mail App
Application.OpenURL("mailto:" + email + "?subject=" + subject + "&body=" + body);
}
string MyEscapeURL(string url)
{
return WWW.EscapeURL(url).Replace("+", "%20");
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612190503im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Launching OSX app with custom URL scheme 2 Answers
Custom url Scheme 1 Answer
[2018.4.4f] iOS url scheme Problem 0 Answers
Crash while opening app with URL Scheme in iOS 8 0 Answers
how i can share my screenshot in base64 data to facebook using Unity ?? 0 Answers