Send Email From Unity – Simple Email System

How to Send email from unity? Don’t know? It’s too easy. Many multiplayer games from unity use email features to improve its stability, robustness and bug fixes. 

send Email from unity

User’s Feedback or Suggestions are very important nowadays.Most of the game developers want their user to see them in a portfolio and share their experience with the development team.

Email is the best thing to share user experience with the development team.Now, the question is How to send email from unity?We can display our email address to the user, but do we get feedback by just displaying email address?The answer is, what can we do to get regular feedback from a user? Do something that user easily send email regularly without interrupts their actual game play.

Is it possible to send email from unity by just one click? Yes, It is.You can do this by this two methods.

  1. Open default app and send mail.
  2. Send email using SMTP server.

Here’s How you can do using default email app in mobile phones.

  • Send Email using default App

      1.Create an empty unity project.

      2.Create a Scripts called MailSender.cs

      3.Create a function called SendEmail in Mailsender Class.

      4.Copy and paste following code into the SendEmail function.

      5.Create a button in unity and set on click listener with the SendMail functions.Don’t forget to set your email address.

      6. Build and Run.

  • Send email using SMTP server

    Send Email using SMTP is really simple and you can do it in unity using System.Net.Mail library.

1. Create an Empty Unity project

2. Create script called SmtpMailSender.cs

3. Create a function inside the class called SendSmtpMail.

4. Copy and paste following code into the SendSmtpMail function.

5.Resolve other library dependencies.

Note: Set API Compatibility Level to “.NET 2.0” and not “.NET 2.0 Subset” in build setting.

Get more helpful asset:

Leave a Reply

Your email address will not be published. Required fields are marked *