question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using MailCompser, working examples as mine stopped working

See original GitHub issue

MailComposer stopped working

Environment

Expo CLI 3.15.5 environment info: System: OS: macOS 10.15.4 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.9.1 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.10.2 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.4 AI-183.6156.11.34.5692245 Xcode: 11.4/11E146 - /usr/bin/xcodebuild npmPackages: expo: ^36.0.0 => 36.0.2 react: 16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 react-navigation: ^2.11.2 => 2.11.2 npmGlobalPackages: expo-cli: 3.15.5

Target app: iOS/Android

Steps to Reproduce

import { MailComposer } from 'expo';

        MailComposer.composeAsync({
            subject: 'test',
            body: 'test',
            recipients: ['teckel@domain.com'],
            isHtml: true
        });

Expected Behavior

Should open an email, like it did previously

Actual Behavior

Throws the error:

TypeError: undefined is not an object (evaluating `_expo.MailComposer.composeAsync’)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvatnecommented, Mar 25, 2020

here’s an example you can run on your phone: https://snack.expo.io/@notbrent/mailcomposer

0reactions
Fabziencommented, May 6, 2022

@Pat-Gekoski

You can use something like that:

MailComposer.composeAsync({
                    recipients: EMAILDEST,
                    subject: YOURSUJECT,
                    body: YOURBODY,
                    attachments: YOURFILE
                }).then((data) => {
                    if (data.status == 'sent') {
                           // YOUR CODE
                    }
                })

AFAIK, it’s only working on iOS. On Android there is no return after using MailComposer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MailComposer not dismissed [duplicate] - Stack Overflow
You are not supposed to use the same MFMailComposeViewController instance again.. Try this
Read more >
MailComposer Attachments not working (android)
It displays a selection of my email applications, and when I select gmail for example, it opens gmail compose, with the title and...
Read more >
Mailcomposer - Nodemailer
Nodemailer is a module for Node.js to send emails.
Read more >
How to Send an Email (Including Attachments) from Expo ...
If you are interested in my code from my expo- mail-composer tutorial ... https://amzn.to/3KNkcBc A nice portable computer for working from ...
Read more >
Sending Emails with Nodemailer Explained - Mailtrap
Example 1. First, let's go back to the HTML template, and check how embedded images work. Input var nodemailer = require('nodemailer'); var ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found