get information from external application

Hi,
I opened my default mail client from my system using,
using UnityEngine;
using System.Collections;

public class sendMail : MonoBehaviour 
{
	
	void OnGUI () 
	{
		if(GUI.Button(new Rect(100, 100, 80, 40), "send mail"))
			Application.OpenURL("mailto:xx@yy.com?subject=hi&body=test");
	}
}

its working fine, i like to get a message from that application (eg. outlook) to unity when user selects send button. Please send me solution.

Regards,
Ben

This is going to be difficult to do and will depend on the email client and the operating system in question. On Windows you could to it by listening to the Win32 messages raised by the email client, but you have to know or somehow detect the HWND of the “send” button or its equivalent in your email application.

It would be much easier if you set your Unity application to not run in the background, and then listen to the OnApplicationFocus event. And when your application regains focus after the user presses the send mail from inside your application, either ask the user if they have sent the email or simply assume that they did.

EDIT

Or, if you’re sure that Outlook is going to be the default email client, you can use COM and C# to send a message through Outlook.