title: Send Email Directly From JavaScript using EmailJS
body: <p>Send Email Directly From JavaScript using EmailJS.</p>
  
  <p>Please look the below answer and I'm getting so many comments for malicious attacks.. because this file is loading in browser so malicious user can easily get your key configuration. So, how to avoid it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> var templateParams = {
      to_name: 'xyz',
      from_name: 'abc',
      message_html: 'Please Find out the attached file'
    };
  
    emailjs.send('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', templateParams)
      .then(function(response) {
        console.log('SUCCESS!', response.status, response.text);
      }, function(error) {
        console.log('FAILED...', error);
      });</code></pre>
  </div>
  </div>
  </p>