# Email Composer error

**URL:** <https://forum.ionicframework.com/t/email-composer-error/52659>\
**Category:** ionic-v3\
**Created:** [May 22, 2016, 5:51am UTC](https://forum.ionicframework.com/t/email-composer-error/52659 "2016-05-22T05:51:23Z")\
**Posts on this page:** 16\
**Page:** 1

<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:** [May 22, 2016, 5:51am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/1 "2016-05-22T05:51:24Z")

</div>

Has anyone had problem with the email composer. I keeping an exception error. Does anyone have any insight?

EXCEPTION: Error: Uncaught (in promise): undefined

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 23, 2016, 3:13pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/2 "2016-05-23T15:13:42Z")

</div>

Could you share some code for what you are trying to do?  
We need some more information, not just the error message, to help you out 😄

---

<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:** [May 23, 2016, 11:34pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/3 "2016-05-23T23:34:08Z")

</div>

I am using the code from the docs and get that code. I would like to mention I am on beta 7 and it looks like it might have something todi with zonejs

import {EmailComposer} from ‘ionic-native’;

EmailComposer.isAvailable().then((available) =\>{  
if(available) {  
//Now we know we can send  
}  
});

---

<div class="post-metadata">

**Author:** ![william\_harris](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/william_harris/32/101865_2.png) [@william\_harris](https://forum.ionicframework.com/u/william_harris)\
**Post date:** [May 24, 2016, 11:46am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/4 "2016-05-24T11:46:39Z")

</div>

Not sure if this is completely related but in beta 7 the isAvailable() method doesn’t work for me, it always exits with the catch statement. In beta 6 I used the same code which worked correctly.

```
EmailComposer.isAvailable().then((available) =>{
    if(available) {
    //Now we know we can send
    }
}).catch(() => { 
    console.log('EmailComposer.isAvailable error'); 
});

```

I’ve tested this on a Samsung s4 and a Samsung s6 and both devices fail.

I would like to point out it only seems to be the isAvailable() method that has this problem. If i comment it out and just call the `EmailComposer.open()` method it works as expected.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 24, 2016, 4:38pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/5 "2016-05-24T16:38:52Z")

</div>

Hmm, seeing this as well. Could you open an issue for this on the ionic-native repo?

---

<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:** [May 24, 2016, 8:26pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/6 "2016-05-24T20:26:09Z")

</div>

You said that open() method is functioning. Care to share your usage.

---

<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:** [May 25, 2016, 2:18am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/7 "2016-05-25T02:18:10Z")

</div>

According to a reply I received on the issue I opened it looks like the issue might be with the plugin itself. I used a different plugin, cordova-plugin-email, and I was able to get it to work using just the open method. I tested the isAvailable method, did get the error, but the available param is undefined.

Other plugin Git - [https://github.com/hypery2k/cordova-email-plugin.git](https://github.com/hypery2k/cordova-email-plugin.git)

---

<div class="post-metadata">

**Author:** ![william\_harris](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/william_harris/32/101865_2.png) [@william\_harris](https://forum.ionicframework.com/u/william_harris)\
**Post date:** [May 25, 2016, 9:03am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/8 "2016-05-25T09:03:30Z")

</div>

Here is a snippet from my code for `EmailComposer.open()`:

```
EmailComposer.open({
                to: 'recepient@fakeemail.com',
                cc: null,
                bcc: null,
                attachments: null,
                subject: 'Test subject',
                body: 'Test body, kind regards Testy McTester',
                isHtml: false
            });
```

---

<div class="post-metadata">

**Author:** ![mahmoudismail](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mahmoudismail/32/103268_2.png) [@mahmoudismail](https://forum.ionicframework.com/u/mahmoudismail)\
**Post date:** [October 21, 2016, 1:36pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/9 "2016-10-21T13:36:32Z")

</div>

Hello,  
Does anyone have any insight?  
EXCEPTION: Error: Uncaught (in promise): undefined

---

<div class="post-metadata">

**Author:** ![mahmoudismail](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mahmoudismail/32/103268_2.png) [@mahmoudismail](https://forum.ionicframework.com/u/mahmoudismail)\
**Post date:** [October 21, 2016, 1:37pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/10 "2016-10-21T13:37:21Z")

</div>

Any solution for this problem ?

---

<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:** [October 28, 2017, 12:57pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/11 "2017-10-28T12:57:04Z")

</div>

I switched to the social sharing plugin which has an email method

---

<div class="post-metadata">

**Author:** ![sampath](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sampath/32/137165_2.png) [@sampath](https://forum.ionicframework.com/u/sampath)\
**Post date:** [November 10, 2017, 11:45pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/12 "2017-11-10T23:45:56Z")

</div>

Thanks, this is the only solution we have.

> **[Ionic Framework](https://ionicframework.com/docs/native/social-sharing/#shareViaEmail)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

---

<div class="post-metadata">

**Author:** ![agordon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/agordon/32/128870_2.png) [@agordon](https://forum.ionicframework.com/u/agordon)\
**Post date:** [October 20, 2019, 5:04am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/13 "2019-10-20T05:04:14Z")

</div>

You need to include it in the providers array in your app.module.ts file. As usual, this is not mentioned anywhere in the docs.

---

<div class="post-metadata">

**Author:** ![agordon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/agordon/32/128870_2.png) [@agordon](https://forum.ionicframework.com/u/agordon)\
**Post date:** [October 20, 2019, 5:11am UTC](https://forum.ionicframework.com/t/email-composer-error/52659/14 "2019-10-20T05:11:57Z")

</div>

If anyone is still having trouble with this, you need to include it in the providers array in your app.module.ts file. As usual, this is not mentioned anywhere in the docs.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [October 20, 2019, 9:51pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/15 "2019-10-20T21:51:45Z")

</div>

> [@agordon](#):
>
> As usual, this is not mentioned anywhere in the docs.

It’s at the bottom of [this page](https://ionicframework.com/docs/v3/native/).

---

<div class="post-metadata">

**Author:** ![agordon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/agordon/32/128870_2.png) [@agordon](https://forum.ionicframework.com/u/agordon)\
**Post date:** [October 21, 2019, 6:51pm UTC](https://forum.ionicframework.com/t/email-composer-error/52659/16 "2019-10-21T18:51:19Z")

</div>

I stand corrected, however I still believe It should have been mentioned on the actual documentation page for Email Composer as this is what the vast majority of user’s will be using as a reference when trying to implement it. It is a crucial step and the plugin will not work without it.
