Emailing forms

Posted on 2007-10-12
Medium Priority
Last Modified: 2010-04-09
Is it possible to email forms in an email. For example I want to create a contact book in which can be updated by me emailing that person a form in which they can fill out and submit by email right there on the spot.
Question by:eteran
  • 2
  • 2
  • 2
  • +1
LVL 13

Expert Comment

ID: 20069421
Sure it can.. if the client supports this type of HTML though. Just point the action attribute of the form to your absolute web address http://(www.example.com/process.asp) and your ready to go :)

Expert Comment

ID: 20069425

'Configure Mail object
Dim CDO                  : Set CDO = Server.CreateObject("CDO.Message")
Dim CDOConfig      : Set CDOConfig = Server.CreateObject("CDO.Configuration")
Dim urn             : urn = "http://schemas.microsoft.com/cdo/configuration/"
With CDOConfig
      .Fields(urn & "sendusing") = 2
      .Fields(urn & "smtpserver") = ""
      .Fields(urn & "smtpserverport") = 25
      .Fields(urn & "smtpconnectiontimeout") = 60
End With
For Each formField in Request.Form
  MSG = MSG & formField & ": " & Request.Form(formField)
With CDO
  .To = "toAddress@domain.com"
  .From = "fromAddress@domain.com"
  .Subject = "Form Details"
  .TextBody = MSG 'Send the above formatted body
  .Send() 'Send the message
End With
Set CDO = Nothing
Set CDOConfig = Nothing

Author Comment

ID: 20069447
okay in the event the user can not view the form is there a way a link can come out or something. I know most email clients do not like java nore asp in th content.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Expert Comment

ID: 20069503
Well, that's not true 'most email clients do not like...asp in th content.'

ASP is a server side only techonology. Active Server Pages. ASP is just a method in which the server creates dynamic information for the client browser.

This is how this should work.....

Put your contact form on a page. That page doesn't have to be an asp page, it could just be a plain HTM page.

Set the action attribute of the form to sent.asp (or thanks.asp or whatever...jsut make sure it's .asp)

Put the code I posted at the top of the .asp page, and fill in the rest of the page with whatever HTML you want.

The code I posted will work as long as your server has had IIS correctly installed. If it's a ChiliSoft/Apache server, I'm not 100% sure what their ASP processor does for mail.

Expert Comment

ID: 20069739
Onthrax is right onthe money. Just send your form in an email and have it post to whatever page you are going to use to process it. Just be aware that not all email programs support html or may not support forms.


Author Comment

ID: 20071009
My question is now should my approch be that way or should I just put a link on the page to go update there contact information. What is going to be more effective. Is there also a way to detect if the email client can view forms or not.
LVL 13

Accepted Solution

Onthrax earned 2000 total points
ID: 20071176
There are a few options.

- You could present an option when people register if they can accept html mails or not. Then using that setting you can automatically determine if the mail should contain a form or link.
- A second option is to insert a link in the mail that will automatically log them in and go to the page containing the form. Although this could present a possible security breach (depending on what kind of site you have) it is most user friendly.

There is no 'better' solution. It's what you prefer yourself that will work.

Hope this helps :)

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question