Getting Started

Do you have forms on your HTML websites but don't want to worry about writing code to handle the submissions?

Meet the Send Form API! Your form security and submission tool, which will process any forms for you.

it's very easy to get started. Simply submit the email address you wish to receive your sumissions in and we will email you a confirmation link.

Retrieve your API code

Enter your email address in the form below and click the Submit button to generate your form action URL.


Your HTML form

<form action="http://sendformapi.com/api/YOUR-API-CODE" method="post">
    <input type="text" name="name">
    <input type="email" name="email">
    <textarea name="message"></textarea>
    <input type="submit" value="Send">
</form>



Style the form as you wish with your template's CSS.

You can also use your existing forms by just setting the form action value to http://sendformapi.com/api/YOUR-API-CODE


Using advanced fields

Specify a custom email subject. You may also allow the sender to specify the subject. If omitted, a default email subject will be used.

<input type="hidden" name="_subject" value="Your contact form subject">

Specify a custom reply to email address for the email.

<input type="hidden" name="_replyto" value="user@email.com">

Instead of specifying a static custom "reply to" address, you can also choose to use an email address entered by the user of the form. In order to do this, give your custom "replyto_" field a value of "%" followed by the name of the field. Let's assume you have a field named "email" which value you'd like to use for your custom "reply to" field, then you'd give you "reply to" field a value of "%email".

<input type="hidden" name="_replyto" value="%email">

Specify one or more CC recipients for the email.

<input type="hidden" name="cc[]" value="user@email.com">
<input type="hidden" name="cc[]" value="user@email.com">

Use the above syntax to specify one or more CC recipients. Please note the name of this field is "cc[]". This allows you to specify any number of entries, rather then just one.

Specify one or more BCC recipients for the email.

<input type="hidden" name="bcc[]" value="johndoe@gmail.com">
<input type="hidden" name="bcc[]" value="janedoe@gmail.com">

Use the above syntax to specify one or more BCC recipients. Please note the name of this field is "bcc[]". This allows you to specify any number of entries, rather then just one.

Specify a URL to redirect the user to after successfully submitting the form.

<input type="hidden" name="_after" value="http://google.com">

This is a special field which also acts as a form of SPAM protection. This hidden field will not be shown to regular visitors, but most SPAM bots will automatically enter a value into this field. If our API detects a value, the data is considered SPAM and won't be processed.

<input type="text" name="_honey" value="" style="display:none">

Send Form API handles attached files easily. Simply add the following element to your form and our API will attach the file to the email it sends out:

<input type="file" name="file">

Set a custom confirmation message to be shown to the user after successfully submitting the form. You do not need to do this if you redirect users after submisions:

<input type="hidden" name="_confirmation" value="<b>Thank you!</b> We have received your message and we will get back to you asap.">

Validating form data

Send Form API comes with built-in form validating capabilities. You can specify a variety of rules for your data; and if the submission does not pass the validation process, the user will be shown a message detailing which validation rules were not passed.

Validation syntax
The validation syntax is simple and straight forward. You simply add a hidden field for each form field you'd like validated, and you name this hidden field "_valid[field_name]" where you replace "field_name" with the name of the field. Please see the basic example below:

<form action="//sendformapi.com/api/YOUR-API-CODE" method="post">
    <input type="hidden" name="_valid[name]" value="required">
    <input type="hidden" name="_valid[email]" value="required|valid_email">
    <input type="hidden" name="_valid[message]" value="required">
    <input type="text" name="name">
    <input type="email" name="email">
    <textarea name="message"></textarea>
    <input type="submit" value="Send">
</form>

In the example above, the form contains three fields to be filled out by the user: name, email and message. Accordingly, three hidden validation fields have been added to the form as well. The "name" field must validate as required, meaning it can not be left empty. The same applies to the "message" field. The "email" field is also required, and in addition it must validate as a proper email address. If any of these requirements are not met, the user will get an error message explaining what is wrong with their data.

Below you'll see an overview of all available validation rules:

Rule Description Example
required Returns FALSE if the form element is empty.
min_length Returns FALSE if the form element is shorter then the parameter value. min_length[6]
max_length Returns FALSE if the form element is longer then the parameter value. max_length[12]
exact_length Returns FALSE if the form element is not exactly the parameter value. exact_length[8]
greater_than Returns FALSE if the form element is less than the parameter value or not numeric. greater_than[8]
less_than Returns FALSE if the form element is greater than the parameter value or not numeric. less_than[8]
alpha Returns FALSE if the form element contains anything other than alphabetical characters.
alpha_numeric Returns FALSE if the form element contains anything other than alpha-numeric characters.
alpha_dash Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.
numeric Returns FALSE if the form element contains anything other than numeric characters.
integer Returns FALSE if the form element contains anything other than an integer.
is_natural Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.
is_natural_no_zero Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.
valid_email Returns FALSE if the form element does not contain a valid email address.
valid_emails Returns FALSE if any value provided in a comma separated list is not a valid email.
valid_ip Returns FALSE if the supplied IP is not valid. Accepts an optional parameter of "IPv4" or "IPv6" to specify an IP format.