DEV Community

MailSlurp
MailSlurp

Posted on

Low-code HTML forms that submit directly to your email address! (Free serverless forms)

I built a free API that you can submit HTML forms to and receive the data to your email - attachments included!

Check it out

Alt Text

Why did I make it?

I wanted an easy way to make contact forms for static websites. With MailSlurp forms you can now create forms that submit to your email address without any server or Javascript.

Example

Just POST any HTML form to https://api.mailslurp.com/forms?_to=YOUR_EMAIL_ADDRESS.

<form action="https://api.mailslurp.com/forms?_to=YOUR_EMAIL" method="post">
  <!-- include any form fields, even files -->
  <textarea name="example"></textarea>
</form>
Enter fullscreen mode Exit fullscreen mode

Any named input field will be put into a table and sent to your email address within seconds.

Attachments

You can add files too by adding an enctype="multipart/form-data" attribute to your <form> element.

<form
  action="https://api.mailslurp.com/forms"
  method="post"
  enctype="multipart/form-data">

  <input multiple name="files" type="file">
  <button type="submit">Send to me</button>

</form>
Enter fullscreen mode Exit fullscreen mode

More settings

You can set the subject, bcc, cc of the email and more by adding query parameters to the url. You can see a full list of config options here.

You can also alias or mask your email address behind an MailSlurp ID so that your email address is not exposed to the public.

<form action="https://api.mailslurp.com/forms" method="post">
  <!-- hide email with an alias (create a free account for this) -->
  <input
    type="hidden"
    name="_toAlias"
    value="9b32cb34-e75a-48a6-8f6c-817204c354e7"
  />
  <!-- data to submit -->
  ...
</form>
Enter fullscreen mode Exit fullscreen mode

Get started

MailSlurp forms are free :). If you want extra features like on demand email addresses, or a MailServer API then you can explore MailSlurp's paid account. Have fun!

Top comments (4)

Collapse
 
lukewduncan profile image
Luke Duncan

Awesome! I've seen an app like this before, but never included attachments. Congrats!

Collapse
 
jair profile image
jair

Nice ❤

Collapse
 
alvaroadlf profile image
Alvaro

Interesting and useful project 👌🏻👌🏻, how long does it take (more or less) to send the email? 👌🏻 👌🏻

Collapse
 
mailslurp profile image
MailSlurp

I believe a few seconds, normally under ten.