Form to Email Plugin

formToEmail Plugin allows you to add forms to your pages.

The content of the form will be sent via email to any email address (or addresses) you specify.

Sample usage

You would add something similar to this to one of your pages (make sure there are no spaces between the brackets:

[formToEmail ]

[subject=Message from {1}] [to=your@email.address][from={2}]

[Your Name:|text|required]

[Your Email:|text|required]

[Your Message:|textarea|required]

[/formToEmail]

Fields are specified by [LABEL|INPUT TYPE|REQUIRED FLAG]

Only LABEL and INPUT TYPE are necessary to add a field to the form. INPUT TYPE can be: text or textarea.

Additional data

To specify where to send the email, use:

[to=YOUR ADDRESS HERE] You can specify several addresses separated by commas

To specify what address to use as the sender, use:

[from=EMAIL ADDRESS]

To add a custom subject use:

[subject=YOUR SUBJECT]

To customize your "Thank you" message (message that appears after the user has successfully submitted the form) use:

[thankYouMessage=YOUR MESSAGE] (do not use html in this message)

Numbers in brackets {} will be replaced by data supplied by user when the form is submitted. In this way, you can use an email address as the "from" attribute of the email or use the name entered as part of the subject for example. Numbers indicate field order. In the above example, "Your Name:" is number 1, and "Your email:" is number 2.

Formatting

Between the form fields, you can add html markup. You can also add html markup inside the brackets if, for example, you wanted to make the labels bold, or to add a break between the label and the form field.

Note: This plugin only handles one form per page.

12 responses to "Form to Email Plugin"

Kevin L.

Kevin L.  on December 02, 2008

Laura,
I can get the plugin to show the form and it seems to function correctly but I never receive an email when the form is used. Is there something special about the [to=email] part of the code that I might need to know?
Thanks
Laura

Laura  on December 04, 2008

Kevin,
Are you able to receive email in other places, like when someone writes a comment? I would check the undeliverable folder in CF and the mail logs in the CF administrator to see what the problem might be.
Andrea

Andrea  on January 28, 2009

Hi Laura,
I am trying the plugin.
Form is this:

[formToEmail]

[thankYouMessage='Thanks for your message. I will reply as soon as possible.']

[subject=Message from {1}] [to=andrea@andreacfm.com][from={2}]

[Your Name:|text|required]

[Your Email:|text|required]

[Your Message:|textarea|required]

[/formToEmail]

I am getting this error:
An error occurred while trying to encrypt or decrypt your input string: Given final block not properly padded.
at cfHandler2ecfc2120875415$funcPROCESSEVENT.runFunction(D:\inetpub\vhosts\andreacfm.com\httpdocs\components\plugins\user\formToEmail\Handler.cfc:194)
kelly

kelly  on April 13, 2009

why does this not work on a post ?
Laura

Laura  on April 13, 2009

Kelly,
The plugin is only set up to show the form in pages, not posts.
JC

JC  on April 23, 2009

How about radio buttons? Being able to give them a yes/no or something would be nice.
salvatore

salvatore  on April 24, 2009

Hi Laura,
how can i change the text after the captcha image, ie transale it in other lang?
regards
Laura

Laura  on May 06, 2009

salvatore,
The captcha image is placed by the captcha plugin. Unfortunately, it doesn't have the ability to change languages from the admin, but you can change the plugin code.

I'd actually recommend to disable the captcha and use the cfformprotect plugin: http://www.mangoblog.org/news/goodbye-captcha-hello-cfformprotect
Mike Henke

Mike Henke  on July 18, 2009

This is awesome. Worked like a champ. Thanks
stacy

stacy  on August 01, 2009

Hi Laura,
My host requires me to use my login and password
to send mail to help prevent spam.
Is there a way to pass this info.
Laura

Laura  on August 02, 2009

stacy,
This plugin uses the global email settings set in the config.cfm file. If your server requires authentication, then you need to fill in the information in that file, inside the "mailServer" node there are keys for "server" "username" and "password".
mike leger

mike leger  on December 03, 2009

love it, thanks. would love to see radial buttons or drop down

Leave a Comment

Leave this field empty: