We help IT Professionals succeed at work.

Emailing forms

eteran asked
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.
Watch Question

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 :)


'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


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.

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.

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.


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.
Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.