0.0.12 • Published 2 years ago

react-native-mail-attachment v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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


0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago