You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-mail-attachment

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-mail-attachment

send email with attachment

0.0.10
Source
npmnpm
Version published
Weekly downloads
12
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-mail-attachment

send email with attachment

Installation

npm install react-native-mail-attachment
yarn add react-native-mail-attachment
cd ios && pod install

Usage

//CLASS 
import MailAttachment from 'react-native-mail-attachment';

const App = () => {
  const recipient = 'recipient@example.com';
  const subject = 'Subject';
  const body = 'Email body';
  const attachmentUri = '/path/to/attachment/file';

  return (
    <>
      <View style={{height: 70}} />
      <TouchableOpacity onPress={
        async () => { 
         MailAttachment.sendEmailWithAttachment(recepient,subject, body,attachmentUri)}}>
        <Text> Send email</Text>
      </TouchableOpacity>
    </>
  );
};


//FUNCTION 
import { sendEmailWithAttachment} from 'react-native-mail-attachment';

const App = () => {
  const recipient = 'recipient@example.com';
  const subject = 'Subject';
  const body = 'Email body';
  const attachmentUri = '/path/to/attachment/file';

  return (
    <>
      <View style={{height: 70}} />
      <TouchableOpacity onPress={
        async () => { 
      sendEmailWithAttachment(recepient,subject, body,attachmentUri)}}>
        <Text> Send email</Text>
      </TouchableOpacity>
    </>
  );
};

// ...



Current API(Property)

PropertyTypeDescription
sendEmailWithAttachmentvoidandroid & ios
pickFilefunctionandroid
recipientstring (optional)render component
subjectstring (optional)email subject
bodystring (optional)email body
URIstring (required)PDF or TXT or jpg

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

react-native

FAQs

Package last updated on 20 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts