3.0.3 • Published 2 years ago

react-mailto.js v3.0.3

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

react-mailto.js

npm version Build Status

Install

npm install react-mailto.js --save

Usage

Import the package to your script:

import Mailto from 'react-mailto.js';

Add <Mailto /> component to your code and use properties described below to config your link:

PropertyTypeExampleDescription
tostring or Array<string>, isRequired'some@email.com', ['some@email.com', 'another@email.com']Email to this person, or multiple persons
subjectstring'This is title'Your email Subject
bodystring'This is body of my email'Your email body
ccstring or Array<string>'some@email.com', ['some@email.com', 'another@email.com']CC email to this person, or multiple persons
bccstring or Array<string>'some@email.com', ['some@email.com', 'another@email.com']BCC email to this person, or multiple persons
securebooleantrueWhen is set to true href of the link will be set to javascript:void(0) to not to leak email to the HTML code

Simple config

<Mailto
  secure={true}
  to="vasyl@zubach.com"
  subject="Some email subject"
  body={['This is the body of your message', 'Multilined also'].join('\n')}
>
  email us
</Mailto>

Full config

<Mailto
  secure={true}
  to={['vasyl@example.com', 'other@example.com']}
  cc={['elena@example.com', 'other@example.com']}
  bcc={['elena@example.com', 'other@example.com']}
  subject="Some email subject"
  body={[
    'Some body',
    'Multilined also',
    'Symbols: ,./!@#$%^&*()_+~`":;<>?',
    "<script>console.log('xss');</script>"
  ].join('\n')}
  onClick={(e) => {
    console.log(e);
  }}
>
  email us
</Mailto>
3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.3.0

3 years ago

2.2.2

3 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.1.0

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago