Я использую npm pacakge, чтобы открыть почтовый клиент с данными: https://www.npmjs.com/package/react-native-mail-compose
Также я использую их пример:
import MailCompose from 'react-native-mail-compose';
// later in your code...
async sendMail() {
try {
await MailCompose.send({
toRecipients: ['to1@example.com', 'to2@example.com'],
ccRecipients: ['cc1@example.com'],
bccRecipients: ['bcc1@example.com', 'bcc2@example.com'],
subject: 'This is subject',
text: 'This is body',
html: '<p>This is <b>html</b> body</p>', // Or, use this if you want html body. Note that some Android mail clients / devices don't support this properly.
attachments: [{
filename: 'mytext', // [Optional] If not provided, UUID will be generated.
ext: '.txt',
mimeType: 'text/plain',
text: 'Hello my friend', // Use this if the data is in UTF8 text.
data: '...BASE64_ENCODED_STRING...', // Or, use this if the data is not in plain text.
}],
});
} catch (e) {
// e.code may be 'cannotSendMail' || 'cancelled' || 'saved' || 'failed'
}
}
и вызываю эту функцию при нажатии кнопки,Все данные в порядке, кроме тела, например, здесь в теме есть «Это тема», в CC почтовых клиентов есть «cc1@example.com», но тело всегда пусто , яне может видеть "Это тело" в почтовом клиенте.