我是 React Native 的新手。我正在構建一個應用程式,其中有一個聯系表格。我想收集所有表單欄位資料,并希望通過單擊提交按鈕將用戶輸入的這些詳細資訊發送到特定的電子郵件。我怎樣才能做到這一點?提前致謝
uj5u.com熱心網友回復:
不確定您是否可以直接從 React Native 應用程式直接發送電子郵件。
您可以嘗試使用react-native-email包。它很容易集成。該包使用鏈接 API
import email from 'react-native-email'//imports the package
handleEmail = () => {//function to send email
const to = ['[email protected]', '[email protected]'] // string or array of email addresses
email(to, {
// Optional additional arguments
cc: ['[email protected]', '[email protected]'], // string or array of email addresses
bcc: '[email protected]', // string or array of email addresses
subject: 'Show how to use',
body: 'Some body right here'
}).catch(console.error)
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/365448.html
下一篇:使用fetch()將原生API請求反應為getmatiAPI在郵遞員中回應良好,但在App中無法正常作業并出現400錯誤
