Using forms in HTML emails
Posted by David Greiner on April 26, 2005
Sometimes it can be very handy to include a HTML form in an email campaign. Whether it's a quick customer survey or a subscribe form for another list, they can be a good way to interact with a recipient right there in their email client. We even use them occasionally to get feedback off you guys.
While they can be useful, there are a number of precautions you need to consider before using them.
Hotmail is a no go
Right off the bat, Hotmail will not allow you to include working forms in an email. Worse still, they actually display the form, but remove bits of code required to make it work. By stripping all values from your <form> tag and removing the name values of all form elements, they render your form useless. Your Hotmail recipients can still complete the form, but when they hit the submit button, nothing happens. This is probably worse than the form not displaying in the first place.
Use GET and not POST
Some email clients, most notably Mac Mail do not support forms that use <form method="post" action="http://.... Because of this, you'll need to use the <form method="get" action="http://... approach, which will write all form contents to the query string of the page they are posted to.
Tabbing won't work
Almost all email clients that provide a preview pane, especially popular email clients like Outlook and Outlook Express don't allow you to tab between form elements. This means that the moment a recipient completes the first field in your form and clicks the TAB key, the focus is automatically switched to another part of the software. This has the potential to confuse a lot of recipients and is something to be wary of.
Recommended Approach
Before deciding whether or not to include a form in your next email campaign, take a close look at your subscriber list. If you notice many Hotmail addresses, make the form available on the web and include a link to the form in your email. If that's not enough to stop you, then considering splitting your subscribers into Hotmail and non-Hotmail and then send a different version to each list. And remember, use GET instead of POST.
35 comments so far
Search all posts
Dig into a category
- Articles/Tips (104)
- Email Newsletter Design (121)
- Happy Customers/Press (91)
- In the Forums (10)
- Interviews & Case Studies (9)
- New Features & Updates (112)
- Observations & Answers (89)
Stay in the loop
Prefer updates via email? Sign up below and we'll send you all the good bits each month.
Popular articles
Why we need standards support in email
Read why standards in HTML email are so important, and what we're doing about it.
Email design guidelines
Learn how to design for images being turned off, preview panes and other useful tips.
CSS support in email in 2007
The CSS support of every popular email environment with recommendations to boot.
Image blocking in email
A roundup of how each of the popular email clients suppress images in HTML email.
Can I use flash in email?
We test flash support in all the popular email clients. The verdict - don't do it.
Email design gallery
Our email design gallery showcases more than 150 amazing email designs sent by our talented customers.
Vijay
wrote on November 24, 2005 3:16 AM
Is it posible to use next generation web forms XForms in emails? As of now the browsers are didn't support the XForms.
Is there any other way to achive the survey form in emails?
Thanks in advance.
Richard
wrote on January 19, 2006 3:59 AM
David,
Thanks again for providing an elegant simple solution to help my team and I serve our growing customer base.
Have you folks given any thought into crafting a Survey module or Survey Product which produces similar simple clean reporting, and if not is there a product that you could recommend?
Dave Greiner
wrote on February 23, 2006 8:27 AM
Hey Richard,
Sorry for the delay in my response, your comment slipped under the radar ;) The best survey tool I've ever used is definitely Survey Monkey.
sunil ahuja
wrote on May 31, 2006 10:31 PM
I need to send a HTML form and i am using php mail function for that.
On HTML page its working fine but when the same page embeded in the outlook mail.
javascript validation and post method on form submission is not working.
any help or suggestion is highly appreciable.
David Yussen
wrote on June 9, 2006 2:01 AM
Sunil - Try enabling the internet zone. (View -> View in Internet Zone). I had this problem when testing a multipart email sent to myself. The default settings in Options may also be an issue - check "Change Automatic Download Settings." Post should work OK; it's my understanding that javascript won't work. You'll need to use server-side validation where submitting launches a browser with a page describing the error.
xcbgcb
wrote on August 9, 2006 9:10 AM
bxcbx
liviu mocanu
wrote on September 1, 2006 1:34 AM
Hi, I'm having a similar problem...I cannot submit form data via POST method from within an email client (outlook express/mozilla tb). However I have notice that on some computers this is working!!!
Any ideas if some security measures need to be adjusted before attempting form submission from email client?
botong
wrote on September 2, 2006 4:54 AM
Hi, I've been looking everywhere for some resources, scripts, forums, etc. to help me out. I am an amateur web designer and I've been having alot of trouble making a comments layout exactly like this. This format is pretty much what I need for a site I am currently revamping. I have my form set up in how I want it to look, but I don't know how to finish executing it.
I pretty much want the user to fill out the form and just hit the post button. Then the page will reload again with the most recent entries descending. I read too many scripts and on-line guides, all I found confusing.
Any clear and concise tips would totally help me out and get me out of this slump.
Tom
wrote on January 16, 2007 6:38 AM
Use a web based form it work every time. :)
Stijn Schrijvers
wrote on January 22, 2007 10:56 PM
Had a look at Microsoft Outlook 2007? And I'm even not talking about the CSS changes in the new Microsoft products...
MB
wrote on January 23, 2007 6:13 PM
Does Flash work in the emails
Dave Greiner
wrote on January 23, 2007 8:24 PM
MB, unfortunately not.
Wikus
wrote on April 24, 2007 1:11 AM
Hey All.
I saw some interesting comments, none of them usefull to me though. I also have a problem with a form tag in OUtlook. The user should hit the Submit button and then Default internet browser should be called. Cant use plain hyperlink cause I need to catch the values in the survey. HELP!
John
wrote on May 8, 2007 3:04 AM
This is exactly the problem I'm trying to resolve. How to submit a form using POST when there is no default browser - it hasn't been installed. It needs to be sent directly from Outlook. Can you call the wininet.dll from within an email?
Michelle
wrote on May 10, 2007 3:05 AM
Outlook 2007 has disabled the use of form tags in emails altogether. It has always been against best practices to use a form within an email and Microsoft just took care of making sure they don't get embedded in the future.
If you use a form in an email and view the mail in Outlook 2007 the form will not show up and the layout of your email will look like it exploaded all over the area where the form was inserted.
You really should have users click through to a landing page that contains the form on the clients website to avoid having the form embedded within the mail.
Before Outlook 2007 in some email clients the form would appear as it was supposed to look but would not function properly so you could still get away with it. This is no longer the case since forms now mess up your email layout in 2007.
Amanda
wrote on May 19, 2007 12:28 AM
i'm trying to send out an html invitation to clients for some free demos we're having. it includes two graphics that won't show up when you try to send the email with Outlook 2007.
i've searched for answers on how to get the images to show up no matter what - people's answers on how to do it have been to do 'new message - insert text from file or file " outlook 2007 does not have any buttons to insert anything into an email. You can only attach a file or attach an item.
I don't want my invitation to appear as an attachment. I want it to appear in the body of the email. I can open my invitation in IExplore and then click on file and then send page by email. My invitation will then appear in the body of the email but the graphics won't show up for other people.
What am I doing wrong? My graphics are saved on a remote server. All my paths are absolute. Everything in the invitation is saved in a root folder. My table in my invitation even shows up fine, and the links that I have work, my graphics just won't show up.
HELP! My boss needs me to send this out asap!
Dave Greiner
wrote on May 19, 2007 9:57 AM
Amanda, that's exactly what our software is for. Create a free account and you'll be sending in minutes.
keronii
wrote on May 23, 2007 3:11 PM
To Amanda:
You can locate whole email in a HTML page located in a remote server. Save an equivalent of that HTML page in your directory. Use file function of PHP to read your HTML page as a text file and put all content into message. Use mail function of PHP to send the whole plain text message to your Yahoo.
In the email, it will read out out as a beautiful HTML
MONIKA
wrote on June 9, 2007 6:03 AM
Hi this is Monika from India, i create this website and also create an html form, but now i want that when a person fill the reservation for room form online and click the submit button the form automatically send to the e-mail address of the hotel. But i dont know which code i need to put in my form n where?
my e-mail address is "monika_rayat@yahoo.co.in". if u hav any suggession so pls mail me on my e-mail address.
thankx
Monika
Roy
wrote on July 11, 2007 8:04 AM
thank For suitable decision :)
Falgun
wrote on July 17, 2007 3:08 AM
Hi Experts,
I have very strange behavior while submiting form.
When i submit from using broswer email contain key=value pair but when i submit form email has attachment which contains key = value pair.
I dont i avoid sending data as attachement.
Please Help.....
Best Regards
Falgun
John Dawson
wrote on July 31, 2007 7:11 AM
David,
Thanks for the very helpful article. I'm finding that Gmail with Firefox also strips the tag, while Gmail with IE7.x.x is works fine with forms. Wondering if you have (or have seen) something similar to "A Guide to CSS Support in Email" for HTML tags. The CSS Matrix is extremely useful... I just haven't found anything yet for HTML.
John Dawson
Dawson Interactive
ipyana
wrote on August 23, 2007 5:16 PM
I real apreciate you for a good job your doing.
I have a problem with the form which im submiting, it contains the symbols like (+ $ & # etc) which I do not understand them, and I wish to omite them. what can I do to remove them.
Flustered
wrote on August 24, 2007 7:08 AM
This may seem somewhat ignorant, but i have an email campaign that i want to send out to a list of only email addresses which our company owns. I do not have any other information about these people besides their email. I want to send them an HTML web form via email that submits the input values into our CRM system via a Webservice. I have a mass emailing system that will send the generic HTML email, but I need to Back-Track the new LEads that are in our system and match them with their email address. Soo.... my question is:
Is there a way to strip out the email Header "To" value so that i can submit it along with the webform, that way i have their email address in our CRM system...
This seems pretty easy, but unfortunately our Mass emailing product is very limited, and i dont want to force our potential leads to re-type their email address if Obviously i already have the information...i just cant merge the information into the body of the html email before sumbission????
Help please!!!!
Dave Greiner
wrote on August 24, 2007 8:23 AM
Hi Flustered, this is something you can do very easily with Campaign Monitor, but each tool is different so I'm afraid I can't tell you how to do it with your own unmentioned software.
Dave Greiner
wrote on August 24, 2007 8:24 AM
John, I agree some kind of HTML reference would be very handy. Hopefully that's something we can get to moving forward.
Robert
wrote on August 25, 2007 12:24 AM
Lovely promising thread. Just what I'm looking for. I need to design a form - a proforma in fact which will be embedded in an email so that customers can send us queries and issues.
I designed a customised Outlook form which worked fine within our own organisation using MS Exchange, but then failed when I tried to send it outside (to a Yahoo! address). It arrived without the form but with a winmail.dat attachment instead.
My next attempt was using a HTML file embedded in the signature of an email. This was received correctly by Yahoo! but the fields of the form were not fixed on the page - as if the form were in VBA design view. Double clicking on the fields allowed them to be filled in as normal and then for the form to be sent back OK but it's kinda unprofessional looking for the fields to be 'movable aroundable' like that.
Anyway, that's the story so far. I'll watch this thread with intereset to see if you guys can come up with something more concrete.
Best regards,
Robert.
Bobik blog
wrote on September 27, 2007 6:50 AM
http://pepqvn.blogspot.com Bobik blog
Bobik blog
wrote on September 27, 2007 6:50 AM
http://pepqvn.blogspot.com Bobik blog
Sahara news
wrote on September 27, 2007 7:18 AM
http://farxd.blogspot.com Sahara news
Free Lime Wire download
wrote on September 27, 2007 8:11 AM
http://free-lime-wire-hi.blogspot.com free lime wire download
Free Lime Wire download
wrote on September 27, 2007 8:11 AM
http://free-lime-wire-hi.blogspot.com free lime wire download
Web Development
wrote on December 28, 2007 12:13 AM
Hi David Greiner,
We would like to know sending form to email in php with HTML type. I mean when we submit the form it has to go in html format with form data.
i found a source for sending html mail in php at http://www.phpfreaks.com/quickcode/easy-code-to-send-HTML-emails-via-PHP/545.php
But this example sending a html message and not from a form. If it possible for you please advice us in this regard.
Thanks in advance
Venkat
Eddie
wrote on April 4, 2008 11:12 PM
Hi all,
We have a basic form on a web page and when the user submits, we want the content of one field to be included in the email.
Before, we were using a javascript code which was triggering Outlook to send an email in the backgroung:
function msg(f) {
f.action = "mailto:"
mailtoandsubject = ((f.mailtoperson.options[f.mailtoperson.selectedIndex].value)+'?cc='+f.mailtoperson2.options[f.mailtoperson2.selectedIndex].value+'&bcc='+f.mailtoperson3.options[f.mailtoperson3.selectedIndex].value + '&subject=' + document.mailer.subject.value);
It doesn't work with outlook 2007.
Any help would be appreciated...
Thanks in advance
Eddie.
Lublin ogłoszenia
wrote on April 16, 2008 9:41 AM
Thanks for interesting article. btw. I really enjoyed reading all of posts. It’s interesting to read ideas, and observations from someone else’s point of view.
Got anything to add?