Image for post
Image for post
Create embeddable HTML forms that submit directly to your email address.

How to build Serverless HTML Forms (3 simple steps with examples)

With MailSlurp you can receive form submissions directly to your email address — no server or Javascript required. Plus it’s free :)

Why? (it’s simple and free)

1. Create an HTML form

<form 
action="https://api.mailslurp.com/forms?_to=YOUR_EMAIL_ADDRESS"
method="post">
<!-- inputs will go here -->
</form>

2. Add inputs you wish to receive

<form 
action="https://api.mailslurp.com/forms?_to=YOUR_EMAIL_ADDRESS"
method="post">
<!-- add any input field -->
<input name="birthday" placeholder="Please enter your birthday">
<button type="submit">Submit</button>
</form>

3. Receive submissions to your email address

// example email contents
Subject: New form submission
Body:
- Birthday: 21/05/90

Additionally, you can control form redirection using a hidden _redirectTo field. Or provide _successMessage and it will be displays by MailSlurp once the form has been submitted.

To include file attachments use <input type="file" name="file"> and set the form attribute enctype="multipart/form-data". For more configuration options see the Forms Documenation.

MailSlurp is a free email API service that let’s developers send and receive emails from code and tests. Check it out!

Test Email API for end-to-end with real email addresses. Support for NodeJS, PHP, Python, Ruby, Java, C# and more. See https://www.mailslurp.com for details.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store