@emailjs/browser
    TypeScript icon, indicating that this package has built-in type declarations

    3.4.0 • Public • Published

    Official EmailJS SDK for Browsers

    SDK for EmailJS.com users.
    Use you EmailJS account for sending emails.

    codecov npm version

    Disclaimer

    This is a browser-only version, otherwise use the REST API.

    Links

    Intro

    EmailJS helps sending emails using client side technologies only. No server is required – just connect EmailJS to one of the supported email services, create an email template, and use our Javascript library to trigger an email.

    Usage

    Install EmailJS SDK using npm:

    $ npm install @emailjs/browser

    Or manually:

    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js'></script>
    <script type='text/javascript'>
       (function(){
          emailjs.init('<YOUR USER ID>');
       })();
    </script>

    Examples

    send email

    var templateParams = {
        name: 'James',
        notes: 'Check this out!'
    };
    
    emailjs.send('<YOUR SERVICE ID>','<YOUR TEMPLATE ID>', templateParams)
    	.then(function(response) {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, function(err) {
    	   console.log('FAILED...', err);
    	});

    send form

    emailjs.sendForm('<YOUR SERVICE ID>','<YOUR TEMPLATE ID>', '#myForm')
    	.then(function(response) {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, function(err) {
    	   console.log('FAILED...', err);
    	});

    Angular X / VueJS / ReactJS

    import emailjs from '@emailjs/browser';
    
    const templateParams = {
        name: 'James',
        notes: 'Check this out!'
    };
    
    emailjs.send('<YOUR SERVICE ID>','<YOUR TEMPLATE ID>', templateParams, '<YOUR USER ID>')
    	.then((response) => {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, (err) => {
    	   console.log('FAILED...', err);
    	});

    Install

    npm i @emailjs/browser

    DownloadsWeekly Downloads

    2,232

    Version

    3.4.0

    License

    BSD-3-Clause

    Unpacked Size

    154 kB

    Total Files

    29

    Last publish

    Collaborators

    • sergey-emailjs