react-native-mailbox
v0.1.0
Published
Send SMTP mails with attachments from React Native
Maintainers
Readme
react-native-mailbox
Send SMTP mails with attachments from React Native
Installation
npm install react-native-mailboxUsage
import { sendMail } from 'react-native-mailbox';
// Configure mail settings
const mailConfig = {
host: 'smtp.gmail.com',
port: 587,
username: '[email protected]',
password: 'your-app-specific-password',
ssl: true,
replyToAddress: '[email protected]',
};
// Send email
sendMail(
mailConfig,
'Email Subject',
'Email Body Content',
['[email protected]'],
['[email protected]'], // optional
['path/to/attachment.pdf'], // optional
['attachment.pdf'] // optional attachment names
);Parameters
mailConfig: Configuration object for SMTP settingshost: SMTP server hostport: SMTP server portusername: Email username/addresspassword: Email password or app-specific passwordssl: Enable/disable SSL (boolean)replyToAddress: Reply-to email address
subject: Email subjectbody: Email body contentrecipients: Array of recipient email addressesbcc: (Optional) Array of BCC email addressesattachmentPaths: (Optional) Array of file paths for attachmentsattachmentNames: (Optional) Array of custom names for attachments
Note
The iOS implementation is currently in development and not thoroughly tested. Pull requests are welcome for any improvements, especially for the iOS implementation.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Author
Made with create-react-native-library
