# Svelte

Svelte (opens new window) is a web framework that compiles an app at build step. The EmailJS SDK will make it very easy to send emails with Svelte.

Below is simple contact form component, ContactUs.svelte:

  import emailjs from '@emailjs/browser';

  function sendEmail(e) {
    emailjs.sendForm('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', e.target, 'YOUR_PUBLIC_KEY')
      .then((result) => {
          console.log('SUCCESS!', result.text);
      }, (error) => {
          console.log('FAILED...', error.text);

<form on:submit|preventDefault={sendEmail}>
  <input type="text" name="user_name">
  <input type="email" name="user_email">
  <textarea name="message"></textarea>
  <input type="submit" value="Send">