# Ionic 2 Open Email Client

**URL:** <https://forum.ionicframework.com/t/ionic-2-open-email-client/49164>\
**Category:** ionic-v3\
**Created:** [April 13, 2016, 3:59am UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164 "2016-04-13T03:59:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![starkemc](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@starkemc](https://forum.ionicframework.com/u/starkemc)\
**Post date:** [April 13, 2016, 3:59am UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/1 "2016-04-13T03:59:17Z")

</div>

Does anyone know of a working example showing how to open the default email program while populating “To” address in Ionic2? I have a list of email addresses and when I click on one I would like to open the default client.

I am pretty new to Ionic and I have scene some conflicting info about which cordova plugin to use.

Thanks !!

---

<div class="post-metadata">

**Author:** ![xr0master](https://avatars.discourse-cdn.com/v4/letter/x/b4bc9f/32.png) [@xr0master](https://forum.ionicframework.com/u/xr0master)\
**Post date:** [April 13, 2016, 6:48pm UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/2 "2016-04-13T18:48:29Z")

</div>

What about mailto?

```auto
<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">Send Mail</a>

```

---

<div class="post-metadata">

**Author:** ![chrisbenseler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chrisbenseler/32/90788_2.png) [@chrisbenseler](https://forum.ionicframework.com/u/chrisbenseler)\
**Post date:** [April 13, 2016, 6:56pm UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/3 "2016-04-13T18:56:41Z")

</div>

I made this implementation in my (ionic 2) app:

```
//javascript
mailto(email) {
   window.open(`mailto:${email}`, '_system');
}

```

in other words, use window.open targeting system defaults.  
It works, too, with other pŕotocols (tel:, http:, etc…)

I installed the inappbrowser plugin.

---

<div class="post-metadata">

**Author:** ![michael\_reiser](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@michael\_reiser](https://forum.ionicframework.com/u/michael_reiser)\
**Post date:** [July 12, 2016, 9:20pm UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/4 "2016-07-12T21:20:01Z")

</div>

Is inappbrowser an absolute requirement for maito: and tel:? I just did window.location=“blahblah@blah” in a function in Android, and it worked perfectly. However, doing the same in iOS gives an error even though all of the items are correctly listed in the config.xml (allow-intent href=“mailto:\*”):

The iOS error: ERROR internal navigation rejected - allow-navigation not set for url=“[mailto:blahblah@blah](mailto:blahblah@blah)”

UPDATE: I added the allow-navigation lines under platform name-“ios” in config.xml. I’m not getting navigation errors anymore. I’m still getting URL can’t be shown, but I think that might be because I’m in an emulator. I"ll update once I can get it deployed to a phone (getting a bunch of entitlements errors when trying to deploy to a physical device. I hate iOS so much)

UPDATE AGAIN: Confirmed. Just add allow-navigation tags as stated above. It works on a physical device.

---

<div class="post-metadata">

**Author:** ![El\_Dee565](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/el_dee565/32/99956_2.png) [@El\_Dee565](https://forum.ionicframework.com/u/El_Dee565)\
**Post date:** [July 13, 2016, 11:27am UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/5 "2016-07-13T11:27:32Z")

</div>

There are two there is an email one and the social one. Both have a solution. Look at those, I used the email one.

---

<div class="post-metadata">

**Author:** ![zhark](https://avatars.discourse-cdn.com/v4/letter/z/41988e/32.png) [@zhark](https://forum.ionicframework.com/u/zhark)\
**Post date:** [January 4, 2018, 9:14pm UTC](https://forum.ionicframework.com/t/ionic-2-open-email-client/49164/6 "2018-01-04T21:14:26Z")

</div>

This works for me. To apply it to a list of emails, you could parameterize the mailto link:

```auto
<ion-item *ngFor="let user of users">
  <a [href]="'mailto:' + user.email + '?Subject=My%20Custom%20Subject'">
    {{user.name}}. . .{{user.email}} //etc.
  </a>
</ion-item>

```
