Bug report best practices: Submitting Issues
I'm not able to send an email message from iOS using Xamarin.Essentials. The app crashes with the following exception: -canOpenURL: failed for URL: "mailto:" - error: "This app is not allowed to query for scheme mailto".
private async void SendMail()
{
try
{
var message = new EmailMessage
{
To = new List<string> { "[email protected]" },
Subject = "Subject",
Body = "Body"
};
await Email.ComposeAsync(message);
}
catch (Exception ex)
{
Debug.WriteLine($"{ex}");
}
}
I want to be able to send a message from iOS, because the exact same code works great on UWP and Android.
Unable to send an email message on iOS. The app crashes with the following exception: -canOpenURL: failed for URL: "mailto:" - error: "This app is not allowed to query for scheme mailto".
Please see under Steps to Reproduce for a code sample
Are you running this on a simulator or on a device? I believe that this API is only available on devices.
Thanks @jamesmontemagno,
it is only a problem within the simulator, on the device everything works as expected.
@jamesmontemagno can you please make sure this gets documented. I was ready to file a bug since I was running into this as well but it's nowhere in the docs that it'll throw this exception on the iOS simulator.
Most helpful comment
Thanks @jamesmontemagno,
it is only a problem within the simulator, on the device everything works as expected.