How to use react-native-mail - 8 common examples

To help you get started, we’ve selected a few react-native-mail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celo-org / celo-monorepo / packages / mobile / src / utils / Logger.ts View on Github external
emailLogsToSupport = async (userId: string) => {
    const combinedLogsPath = await this.createCombinedLogs()
    if (!combinedLogsPath) {
      return
    }

    const deviceInfo = {
      version: DeviceInfo.getVersion(),
      buildNumber: DeviceInfo.getBuildNumber(),
      apiLevel: DeviceInfo.getApiLevel(),
      deviceId: DeviceInfo.getDeviceId(),
    }

    const emailSubject = 'Celo support for ' + (userId || 'unknownUser')
    Mailer.mail(
      {
        subject: emailSubject,
        recipients: [CELO_SUPPORT_EMAIL_ADDRESS],
        body: `<b>Support logs are attached...</b><b>${JSON.stringify(deviceInfo)}</b>`,
        isHTML: true,
        attachment: {
          path: combinedLogsPath, // The absolute path of the file from which to read data.
          type: 'txt', // Mime Type: jpg, png, doc, ppt, html, pdf, csv
          name: '', // Optional: Custom filename for attachment
        },
      },
      (error: any, event: any) =&gt; {
        this.showError(error + ' ' + event)
      }
    )
  }
github EdgeApp / edge-login-ui / packages / edge-login-ui-rn / src / native / components / screens / existingAccout / RecoverPasswordScreenComponent.js View on Github external
openEmailApp = () =&gt; {
    const body =
      s.strings.otp_email_body +
      this.props.username +
      '<br><br>' +
      'iOS <br>edge://recovery?token=' +
      this.props.backupKey +
      '<br><br>' +
      'Android https://recovery.edgesecure.co/recovery?token=' +
      this.props.backupKey

    Mailer.mail(
      {
        subject: s.strings.otp_email_subject,
        recipients: [this.state.emailAddress],
        body: body,
        isHTML: true
      },
      (error, event) =&gt; {
        if (error) {
          console.log(error)
          this.setState({
            emailAppNotAvailable: true
          })
        }
        if (event === 'sent') {
          this.props.returnToSettings()
        }
github dereksweet / ComedyCompanion / src / services / EmailService.js View on Github external
deliverEmail() {
    let body = this.solid_bits + this.in_development_bits + this.set_lists;

    if (this.email_type == 'formatted') {
      body = body.replace(/(\r\n|\n|\r)/g,"<br>");
    }

    Mailer.mail({
      subject: 'Comedy Companion Export - ' + moment(new Date()).format("MMM DD, YYYY"),
      recipients: [this.email],
      body: body,
      isHTML: this.email_type == 'formatted'
    }, (error, event) =&gt; {
      if(error) {
        alert('Could not send mail. Please send a mail to dereksweet@gmail.com');
      }
    });
  }
github rainbow-me / rainbow / src / components / SendFeedback.js View on Github external
const handleSendFeedback = () => {
  const feedbackEmailOptions = {
    recipients: [FeedbackEmailAddress],
    subject: lang.t('wallet.feedback.email_subject'),
  };

  return Mailer.mail(feedbackEmailOptions, handleSendFeedbackError);
};
github christopherdro / react-native-html-to-pdf / HTMLToPDFExample / index.ios.js View on Github external
RNHTMLtoPDF.convert(options).then((result) => {
    RNMail.mail({
        subject: '',
        recipients: [''],
        body: '',
        attachmentPath: result,
        attachmentType: 'pdf',
      }, (error, event) => {
        if(error) {
          AlertIOS.alert('Error', 'Could not send mail. Please send a mail to support@example.com');
        }
      });
    });
  },
github EdgeApp / edge-react-gui / src / modules / UI / scenes / Plugins / EdgeProvider.js View on Github external
openEmailApp (emailAddress: string) {
    Mailer.mail(
      {
        subject: '',
        recipients: [emailAddress],
        body: '',
        isHTML: true
      },
      (error, event) => {
        if (error) showError(error)
      }
    )
  }
github EdgeApp / edge-react-gui / src / modules / UI / scenes / Plugins / EdgeProvider.js View on Github external
openEmailApp (emailAddress: string) {
    Mailer.mail(
      {
        subject: '',
        recipients: [emailAddress],
        body: '',
        isHTML: true
      },
      (error, event) => {
        if (error) showError(error)
      }
    )
  }

react-native-mail

A wrapper on top of MFMailComposeViewController from iOS and Mail Intent on android

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular react-native-mail functions