Game Development Reference
In-Depth Information
Fig 8.6 A simple email form screen in Unity.
Unity Hands On
Sending Mail via a Web Server
This method of sending an email from your app may be preferred as the
application will not close to open the mail app. Data are sent straight
from the app to the server. You can also use this method for passing
other information to a Web server.
Step 1. Create a new Unity Project.
Step 2. Create a JavaScript file called emailViaServer and add the code
shown in Listing 8.5 . Note that the server URL is shown in bold in the
code. This is where you put the URL of your own server.
Listing 8.5 Sending Data from a Unity App to a Web Server
for the Purpose of Emailing
private var toEmail = "test@email.com";
private var nameField = "My Name";
private var messageField = "Message";
private var showWebMessage = false;
Search Nedrilad ::




Custom Search