The sample HTML survey form in email shall look like
Ideally we can send an email to user and include just the URL of the survey page instead of the complete HTML as a part of the mail itself. But in many cases such as surveys, feedbacks the willingness of clicking on URL and opening it in browser and then submitting the same is less.
Whereas if we provide the same HTML Form as a part of email itself then the probability of filling and submitting these kinds of surveys/ feedbacks is more.
Generally whenever I wanted to send any formatted HTML in mail I used to design with my favorite designer/editor and then browse the HTML in any browser and then copy from browser and paste in the new mail window of outlook.
This time also I did the same and see what; my usual method is failed when I pasted the formatted HTML from browser to outlook. Surprisingly outlook removed only the FROM tag from my all HTML content. And hence the user will not able to submit the survey to any website.
This time it replace FROM tag as just simple text as below
I tried all possible things but no luck. Then I thought if somehow I put this FORM tag as part of mail body then it might work. So started generating the complete mail programmatically including FORM tag and send it to the user, and there we are, we got the solution. Now user can fill and submit the form from email itself.
Here I did very simple string formation using C#
And then finally set this as mail body and send the mail.
But before using this solution I want to highlight few things
- It’s not good idea to have forms as part the mail itself, but if situation demands here is the solution.
- If you want to do any script validation (JavaScript), then by default in outlook it’s disabled as a result none of the JavaScript will be fired.
- I tried submitting from Outlook 2007 it didn't work, probably there might be some security constraint.
- If the generated mail is forwarded then the recipient of the mail cannot submit the form as outlook would remove the FORM tag.
Hope this information helps you.In case if you find any information here is wrong please feel free to write to me Bharat.Mane@gmail.com
Thank You
Bharat Mane