Required help: IOS sms and Mailto: not working

I added below code but for SMS and mailto both are not working in IOS device?
I tried different options with external class but not working.

<a className="external" href="mailto:[email protected]">John Frank</a>
<a href="#" onclick="window.location='mailto:[email protected]'; return false;" className="external">email</a>

<Link iconOnly className="external center-btn" href="mailto:[email protected]" target="_system">
    <span><Icon material="email"></Icon>Send SMS</span>
</Link>

<Link iconOnly className="external center-btn" href="mailto:[email protected][email protected]&subject=Greetings%20from%20Cupertino!&body=Wish%20you%20were%20her" target="_system">
   <span><Icon material="mail"></Icon>Send SMS</span>
</Link>

<Link iconOnly className="external center-btn" href="sms:11 111 11 11" target="_system">
   <span><Icon material="sms"></Icon>Send SMS</span>
</Link>

Is this Cordova app or web app?

1 Like

Is it related [SOLVED] How to use href="tel:11111" to dial ?

Yes, I’m using (https://framework7.io/react/).

Yes It’s related to that one, but I think we are using app inside the framework might be that is the causing issue but still I’m not sure why it’s not working.

Do you have the correct intents in your config.xml?

Thanks @PPetree & @nolimits4web,

It’s working now (the issue was from the APP side. We did a callback so APP can listen to and detect the mailto then launched the mail app).

Thanks - Vinod

1 Like

Hello @VinodKumar,

I have the same issue, only on iOS on Cordova: when I click my tel or mailto links in my cordova app, I have a Failed to load resource: unsupported URL error in the console.

Could you detail the solution you found?

Many thanks in advance!

Check your content-security-policy.

I had but it changed nothing :frowning:

But I found a solution:

open(link) {
  const isCordova = this.$f7.device.cordova;
  const open = isCordova ? window.cordova.InAppBrowser.open : window.open;
  open(link, isCordova ? '_system' : '_self');
},

Where link is a mailto:, tel: or sms: kind of link.

An important notice that would have saved me hours: this do not work with the emulator! It will make a Failed to load resource: unsupported URL error in the console. But it works well on real device (iOS Cordova app, iOS PWA, Mac Desktop Chrome…)

I still have to test on Android (cordova and PWA), but hopefully it will work well (I will edit my post if it is not the case). EDIT: it works :slight_smile:

Hi @Pitouli,

Sorry for the late reply, please try below code might be help.

sendEmail(e) {
let emailVal = “[email protected]”,
emilSub = “Sample data”,
textareaVal = “Lorem ipusum text”;

window.location = mailto:${emailVal}?subject=${subjVal}&body=${textareaVal};
}
<a href="#" onClick={(e) => this.sendEmail(e)}>email

1 Like

Thanks @VinodKumar :slight_smile:
I found a solution that works with my setup: Required help: IOS sms and Mailto: not working