---
title: "Connect Vue forms to email"
canonical: "https://glueforms.com/docs/connect-vue"
language: "en"
description: "Create a Vue contact component with native form submission and receive its messages by email through GlueForms."
---

# Connect Vue forms to email

Receive messages from a Vue contact component with a native form submission. The input names become fields in GlueForms, so this example needs no reactive state or submit handler.

## Connect the form

1. In GlueForms, open [Forms](https://glueforms.com/app/forms), choose your form and copy its receiving URL. Select it above, or replace `YOUR_FORM_URL` in the example.
2. Create `src/components/ContactForm.vue` with the template below.

```html
<template>
  <form action="YOUR_FORM_URL" method="POST">
    <label>
      Name
      <input name="name" autocomplete="name">
    </label>
    <label>
      Email
      <input name="email" type="email" autocomplete="email" required>
    </label>
    <label>
      Message
      <textarea name="message" rows="4" required></textarea>
    </label>
    <button type="submit">Send message</button>
  </form>
</template>
```

3. Import the component into the page where you want the form. In a Vue/Vite project, this `src/App.vue` example renders it.

```html
<script setup>
import ContactForm from './components/ContactForm.vue';
</script>

<template>
  <ContactForm />
</template>
```

Keep the native `action` and `method` attributes. Adding `@submit.prevent` without an alternative submission handler stops this form from sending.

A native submission opens the GlueForms JSON receipt in the browser. Use [JavaScript](https://glueforms.com/docs/javascript) to show a confirmation on your own page.

Publish the page and submit a message. Open it in GlueForms to check the field names, saved content and email notification.

Official documentation: [Vue Single-File Components](https://vuejs.org/guide/scaling-up/sfc.html), [Vue event modifiers](https://vuejs.org/guide/essentials/event-handling.html#event-modifiers).
