Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity android send email

Discussion in 'General Discussion' started by MerhatPandzharov, Sep 6, 2015.

  1. MerhatPandzharov

    MerhatPandzharov

    Joined:
    Aug 29, 2015
    Posts:
    82
    Hello my friends!
    I am making a quiz game so i want someone to can send me their questions for the game ad i will add them into the game so there is my script http://pastebin.com/Cipy3L75
    So it is working perfectly on my PC but on the android it is not working
    What is wrong ?
    Thanks for tha atention :)
     
  2. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    belongs to the android forum section

    btw sending email like that hidden is not allowed on all mobile platforms. You must invoke the platform email client and allow user to send it or not. Else you need to use own server to collect the answer and have subsystem there to send.
     
    theANMATOR2b likes this.
  3. MerhatPandzharov

    MerhatPandzharov

    Joined:
    Aug 29, 2015
    Posts:
    82
    That is bad :( i still don't know much about servers, databases but i think it is time to learn :)
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    You don't have to learn databases. You simply need a cheap hosting account that supports PHP and then use something similar to the following (my PHP is rusty, but this should work).

    Code (csharp):
    1. <?php
    2. mail($_GET['address'], $_GET['subject'], wordwrap($_GET['message'], 70));
    3. ?>
    You'd use it like so.

    Code (csharp):
    1. http://www.address.com/script.php?address=someone@example.com&subject=whatever&message=blah
    Documentation reference links below.

    http://www.tutorialspoint.com/php/php_get_post.htm
    http://www.w3schools.com/php/func_mail_mail.asp
     
    theANMATOR2b likes this.
  5. MerhatPandzharov

    MerhatPandzharov

    Joined:
    Aug 29, 2015
    Posts:
    82
    Thanks mate but this php is scaring me :D can you do it with JS ? :)
     
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Yes, but PHP is far more widespread and you're likely to find cheaper hosting services for it than JS. Things may have changed since I last looked though so you'll want to dig around. Here is the list of server-side JavaScript implementations.

    https://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions
     
  7. intoscienceDing

    intoscienceDing

    Joined:
    Nov 29, 2012
    Posts:
    10
    SMTP should work on Android client. Have you tried to build App with .net 2.0 instead of .net 2.0 subset?