示例#1
0
    // If send button is pressed, it will call this method
    // (must be defined in Unity inspector)
    public void SendButtonPressed()
    {
        // Build current date
        thisDate = System.DateTime.Now.ToString("dd.MM.yyyy");
        Debug.Log("Date: " + thisDate);

        // First line of email body to explain content of each column
        emailBody = "Date,Task,hours,minutes,seconds";

        // Concatenate data from each timer to email body
        foreach (GameObject myTimer in GameObject.FindGameObjectsWithTag("TimerObject"))
        {
            if (myTimer.name == "Timer")
            {
                Debug.Log("Timer found!");
                emailBody = emailBody + "\n" + thisDate + "," + myTimer.GetComponent <Timer> ().timerName + "," + myTimer.GetComponent <Timer> ().hours + "," + myTimer.GetComponent <Timer> ().minutes + "," + myTimer.GetComponent <Timer> ().seconds;
            }
        }
        Debug.Log(emailBody);

        // use SendMailCrossPlatform to send email
        SendMailCrossPlatform.SendEmail(emailAddress, emailHeader, emailBody);
    }
示例#2
0
 public void SendEmail()
 {
     SendMailCrossPlatform.SendEmail("*****@*****.**", "Jeu Word war", "Concernant le jeu Word War ...");
 }