Form on Web Page By Email

Discussion in 'ASP General' started by Rahul Chatterjee, Jun 15, 2005.

  1. Hello All

    I have a web page which has a registration form. The user inputs data in the
    form and I would like to be able to send the entire form contents to an
    email address (In the HTML format). What is the best and easiest method to
    do this? Do I have to capture each element of the form and string it to the
    body and then send it out in the page or is there any faster way to grab the
    entire contents of the form entirely and attach to the body?

    Thanks
    Rahul Chatterjee, Jun 15, 2005
    #1
    1. Advertising

  2. One of the easiest (though not necessarily best) methods to do this, is to
    change the action attribute to "mailto:theEmailAddressHere", method= "post"
    enctype="text/plain". However, this will give a resulting email of
    name_of_the_form_element=value_of_element. For example:
    name=A Name
    sex=M
    income=Under $25000
    Where the name was a text field, sex was a radio button, and income was a
    select box. If this seems good enough, I would also suggest throwing in a
    Javascript alert window (or something) to let the users know that something
    just happened.
    Hope that helps

    "Rahul Chatterjee" wrote:

    > Hello All
    >
    > I have a web page which has a registration form. The user inputs data in the
    > form and I would like to be able to send the entire form contents to an
    > email address (In the HTML format). What is the best and easiest method to
    > do this? Do I have to capture each element of the form and string it to the
    > body and then send it out in the page or is there any faster way to grab the
    > entire contents of the form entirely and attach to the body?
    >
    > Thanks
    >
    >
    >
    Tyler@Thomson, Jun 15, 2005
    #2
    1. Advertising

  3. Rahul Chatterjee

    Adrienne Guest

    Gazing into my crystal ball I observed "Rahul Chatterjee"
    <> writing in
    news:O614G#:

    > Hello All
    >
    > I have a web page which has a registration form. The user inputs data
    > in the form and I would like to be able to send the entire form
    > contents to an email address (In the HTML format). What is the best and
    > easiest method to do this? Do I have to capture each element of the
    > form and string it to the body and then send it out in the page or is
    > there any faster way to grab the entire contents of the form entirely
    > and attach to the body?
    >
    > Thanks
    >
    >
    >


    <%

    msg = "<body>"
    msg = msg & "<p>Here is the contents of your form:</p>"
    msg = msg & "<ul>"
    For ix = 1 to Request.Form.Count
    field = Request.Form.Key(ix)
    InputValue = Request.Form.Item(ix)
    msg = msg & "<li>" & field & ": " & InputValue & "</li>"
    Next
    msg = msg & "</ul>"
    msg = msg & "</body>"

    'do whatever else you need to do to send mail
    %>

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jun 15, 2005
    #3
  4. This looks good - quick and simple. Is there any way to get the output to
    come out in HTML format
    "Tyler@Thomson" <> wrote in message
    news:...
    > One of the easiest (though not necessarily best) methods to do this, is to
    > change the action attribute to "mailto:theEmailAddressHere", method=

    "post"
    > enctype="text/plain". However, this will give a resulting email of
    > name_of_the_form_element=value_of_element. For example:
    > name=A Name
    > sex=M
    > income=Under $25000
    > Where the name was a text field, sex was a radio button, and income was a
    > select box. If this seems good enough, I would also suggest throwing in a
    > Javascript alert window (or something) to let the users know that

    something
    > just happened.
    > Hope that helps
    >
    > "Rahul Chatterjee" wrote:
    >
    > > Hello All
    > >
    > > I have a web page which has a registration form. The user inputs data in

    the
    > > form and I would like to be able to send the entire form contents to an
    > > email address (In the HTML format). What is the best and easiest method

    to
    > > do this? Do I have to capture each element of the form and string it to

    the
    > > body and then send it out in the page or is there any faster way to grab

    the
    > > entire contents of the form entirely and attach to the body?
    > >
    > > Thanks
    > >
    > >
    > >
    Rahul Chatterjee, Jun 15, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    508
    AdamM
    Jul 27, 2004
  2. =?Utf-8?B?SnVzdGlu?=

    Problem Sending email form web form

    =?Utf-8?B?SnVzdGlu?=, Feb 21, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,477
    =?Utf-8?B?U2hhdW4=?=
    Feb 21, 2005
  3. NickH
    Replies:
    9
    Views:
    156
    Randy Webb
    Jan 22, 2004
  4. Replies:
    1
    Views:
    675
    Randell D.
    Mar 17, 2005
  5. Replies:
    13
    Views:
    431
    Randy Webb
    May 14, 2006
Loading...

Share This Page