React-Native向电子邮件发送消息

时间:2019-01-20 13:53:46

标签: react-native

我尝试使用react-native-sms发送消息:

import SendSMS from 'react-native-sms'

//some stuff

someFunction() {

    SendSMS.send({
        body: 'The default body of the SMS!',
        recipients: ['my email address'],
        successTypes: ['sent', 'queued'],
        allowAndroidSendWithoutReadPermission: true
    }, (completed, cancelled, error) => {

        console.log('SMS Callback: completed: ' + completed + ' cancelled: ' + cancelled + 'error: ' + error);

    });
}

但是我没有收到电子邮件中的消息。有什么好方法可以通过电子邮件发送消息吗?

2 个答案:

答案 0 :(得分:0)

react-native-sms用于发送短信而不是电子邮件

recipients应该是一个字符串数组

  

提供默认情况下显示的电话号码收件人

https://github.com/tkporter/react-native-sms/blob/master/README.md#using-the-module

如果要发送电子邮件,请查看本教程 https://medium.com/@jordan_shifter/send-an-email-with-react-native-947a44da4a4c

答案 1 :(得分:0)

react-native-sms用于发送短信

有使用其他应用Medium article by Tymchyk Maksym

的解决方法

但是,您可以制造一个Node.js后端服务器,并使用某种API和Sendgrid(或其他电子邮件服务)使Node.js传递电子邮件Sendgrid for Node

相关问题