在我的应用程序中,我有一个与我们联系的组件,以便将电子邮件发送给公司,我正在使用react-native-mailcore库,因为我已经遵循https://www.npmjs.com/package/react-native-mailcore此过程。但是我收到错误消息MailCore.sendMail()是未定义的,我已经检查了很多次程序
要了解我的问题,我要添加一些代码
MailCore.sendMail({
hostname: 'smtp.gmail.com',
port: 465,
username: 'email',
password: 'myPassword',
from: {
addressWithDisplayName: 'From Codism',
mailbox: 'email'
},
to: {
addressWithDisplayName: 'To Codism',
mailbox: 'email'
},
subject: 'Testing RN MailCore' + new Date(),
htmlBody: `<h1> How is it going </h1>
<p> Test message </p>
`
})
.then(result => {
alert(result.status);
})
.catch(error => {
alert(error);
});