Unity - Send Email From Your Game

If you have developed a game and is in the Playstore, you might want to let your users contact you, be it for suggestions, feedback, ideas or whatever. Now, the question is How do we allow our users contact us?
Display our Email Id? Well, the chances of getting the feedback/suggestions/ideas with this is very less. 

How do we do this then?
Well, we will just add a Unity button and on clicking this button, it would navigate to the user's default Mail App. 

Create a New Scene and add a new Unity Button in the scene. Add an OnClick listener to it. 

Create a new C# Script and name it as SendMail. Attach this script to Main Camera. Open the script and paste the below code.

using UnityEngine;
using System.Collections;

public class SendMail : MonoBehaviour {

 public void EmailUs () 
  //email Id to send the mail to
  string email = "admin@thegamecontriver.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");

Save the script and move to Unity. To the OnClick listener added to the button. Add the Main Camera in the Gameobject field, SendMail.EmailUs in the Function field.

Unity - Send Email From App

Once you save the scene and build it. Run it on your device and on clicking the Send Mail Button, you should be navigated to your Mail App. The screenshot demonstrates the gist of this post

Unity - Send Email From Game

See you around.
Share on Google+

About Unknown

Sujit Horakeri is a game freak just like any other next door guy you would come across. He is a Web Developer by Profession, Game Developer by Choice.


  1. Looks great, but I get a parser error (Unexpected symbol '<') on line 20.
    Coding is not my strong point. Can you help?

  2. Very clear, works fine. Thanks!

  3. Nice approach, better than using SmtpClient for sure.

  4. Hi, Thank you, It´s been very helpful. I would like to know how can attach a file in the mail?

  5. Can get yet can not send email is an exceptionally regular issue confronted, particularly when we are voyaging. There are various kinds of send letters issues and different mistake messages you may get. Checking couple of critical things would enable make plans to issue. Click Here

  6. a given article is very interesting and very useful for me, and pardon me permission to share articles here hopefully helpful and useful
    Godaddy Renewal Coupon Brock Lesnar

  7. This comment has been removed by the author.

  8. Thanks for this post, very useful! I'm using improver.io — best tool for contact finding and sourcing. Check out, it's free.candidate contact information

  9. Email marketing can be a success especially when you embrace email verification. Here are some of the benefits that you stand to enjoy when you take time to verify email addresses before sending out any mails.email validation

  10. You can encourage your current subscribers to share or forward your emails by including social media buttons and email to a friend button in your emails.phishing email meaning

  11. If you are still are not convinced on why your company needs a good email verification tool, then read on for more details:email verification

  12. Thanks for sharing this code. Works perfectly!

  13. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. Email List USA

  14. I’ve heard that it’s important to verify and check all emails on your list. From what I’ve read, it’s an easy way to get better results with your email campaign. Based on recommendations, I think I’ll try Neverbounce, do you have experience with them?

  15. Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. www.hotmail.com

  16. hi any option for attachment.... for Texture2d or Image..?

  17. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging, Email Database

  18. Thanks for sharing this information with us,your blog provided us with valuable information to work with.usd to pkr

  19. Amazing content thanks for sharing this valuable content with uswww.hotmail.com

  20. You can also add offers and email sign up the link in the description box. So, YouTube can help you to grow your email list.
    Email List for Marketing

  21. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... https://hotmail-login.email/