Game Development Reference
messageField = GUI.TextArea (Rect (100, 120, 200, 200),
Step 3. Attach this code to the Main Camera. You can test this
application in the Unity Editor as it does not require your mail
program. It will send data to a server and the server will send
the email. Remember to check your spam folder for the test
Step 4. The server code is written in php. The code is very simple.
In this case, emailer.php is given in Listing 8.6 .
Listing 8.6 php Web Emailer
$to = $_POST["to"];
$subject = $_POST["subject"];
$body = $_POST["body"];
$headers = 'From: mobileEmailTester@someweb.com' . "\r\n" .
'Reply-To: firstname.lastname@example.org' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if (mail($to, $subject, $body, $headers))
echo("<p>Message successfully sent!</p>");
echo("<p>Message delivery failed...</p>");
If you have access to a php-enabled Web server, try creating your own php
server file with this code and redirect your mobile app to it. The full URL of
emailer.php should appear in the sendEmail() function of Listing 8.5 .