Page 1 of 1

Compose Email

Posted: Mon Apr 11, 2016 8:39 am
by JS-Support @Userware
Hi,

Please find below the code for composing a new email from within your app (this will cause the default mail application to open with the specified recipient address, subject, and body):

(Requires beta 7.2 or newer)

Code: Select all

public static void ComposeEmail(string recipientEmailAddress, string emailSubject, string emailBody)
{
    if (!CSHTML5.Interop.IsRunningInTheSimulator)
    {
        CSHTML5.Interop.ExecuteJavaScript("location.href = 'mailto: ' + $0 + '?subject=' + $1 + '&body=' + $2", recipientEmailAddress, emailSubject, emailBody);
    }
    else
    {
        System.Windows.MessageBox.Show("Composing an email is not supported inside the Simulator. Please run the final application instead.");
    }
}}


Regards,
JS-Support