🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
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.12
latest
Source
npm
Version published
Weekly downloads
16
300%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-mail-attachment

Send email with attachment

Installation

react-native > 0.72.0 (currently)

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(attachmentUri,recipient,subject, body)}}>
        <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(attachmentUri,recipient,subject, body)}}>
        <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 21 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