react-native-mail
react-native-mail copied to clipboard
Does not work on IOS 14.8.1
Hi guys i have problem with my Project. i use react native mail to send my PDF file to mail. It was work well on Android but on IOS it was show up and gone right away. I dont know why?. Wait yours help, thanks you!
Same thing on ios 15.6
Put Mailer.mail() in setTimeout and provide some delay.
setTimeout(() => {
Mailer.mail(
{
subject: 'subject',
recipients: ['[email protected]'],
ccRecipients: ['[email protected]'],
bccRecipients: ['[email protected]'],
body: 'Body',
isHTML: true,
attachments: [
{
// Specify either path or uri to indicate where to find the file data.
// The API used to create or locate the file will usually indicate which it returns.
// An absolute path will look like: /cacheDir/photos/some image.jpg
// A URI starts with a protocol and looks like: content://appname/cacheDir/photos/some%20image.jpg
// path: data?.url, // The absolute path of the file from which to read data.
uri: data?.url, // The uri of the file from which to read the data.
// Specify either type or mimeType to indicate the type of data.
type: data?.fileType, // Mime Type: jpg, png, doc, ppt, html, pdf, csv
mimeType: '', // - use only if you want to use custom type
name: '', // Optional: Custom filename for attachment
},
],
},
(error, event) => {
console.log('Mailer --- ', error);
},
);
}, 1000);