Windows Phone 8.1 Plugin

I have created a windows phone plugin for unity3d to open windows phone mail client to compose email. its giving following error

Unhandled ‘Platform.COMException’ exception caught! - 'The request is not supported.

The request is not supported. (Exception from HRESULT: 0x80070032)', Sender: ‘’. Missing try/catch blocks.

the code is as below
public static void sendMail(string to, string subject, string message)
{
// sendMailAsyn(to,subject, message);
composeMail(to, subject, message);

}

private static async void composeMail(string to, string subject, string message)
{
EmailMessage email = new EmailMessage();

email.To.Add(new EmailRecipient(to));

email.Subject = subject;
email.Body = message;
await EmailManager.ShowComposeNewEmailAsync(email);

}

Try using in in a simple WP 8.1 app without Unity.
It might be that you need to run it on UI thread.

i created simple WP 8.1 app without unity and it works fine.
how to run it on UIThread ?

If from Unity script, then UnityEngine.WSA.Application.InvokeOnUIThread().
Same method is available in AppCallbacks class.

wow,
it works
Thank you :slight_smile: