cdonts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zoe Clark
    New Member
    • Sep 2007
    • 1

    cdonts

    Hi,
    How can I edit the below text so that when someone fills in the enquiry box, the email goes automatically to me without having to type in the address in the box?

    [html]
    <html>
    <head>
    </head>
    <body>
    <form method="post" action="cdonts. asp">
    Complete this form and click the submit-button. We will answer your questions as soon as possible.
    <br><br>
    Your Email Address<input type="text" size="25" name="email"><b r>
    <br> Enter your question <br>
    <textarea name="body" cols="40" rows="15" wrap="PHYSICAL" ></textarea>
    <br> <input type="submit" value=" Submit ">
    </form>
    </body>
    </html>[/html]
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    If I understand you correctly, you have a form in which a user enters a message and his or her email address, and this form is sent to an asp script which sends an email to you from the email address specified by the user. You want to modify this so that the "from" field is already filled in? The simplest solution would be to hide and supply a value for this input: [html]<html>
    <head>
    </head>
    <body>
    <form method="post" action="cdonts. asp">
    Complete this form and click the submit-button. We will answer your questions as soon as possible.
    <br><br>
    <input type="hidden" name="email" value="myEmail@ address.com"><b r>
    <br> Enter your question <br>
    <textarea name="body" cols="40" rows="15" wrap="PHYSICAL" ></textarea>
    <br> <input type="submit" value=" Submit ">
    </form>
    </body>
    </html>[/html] Although this works, It might be better to handle this on the next page "cdonts.asp ". This probably has some line like this: [code=asp]emailAddr = request.form("e mail")[/code]
    this would just need to be changed to:
    [code=asp]emailAddr = "myEmail@addres s.com"[/code]I think this approach would be better especially if you want to hide your address, a "hidden" form field is actually fairly easy to read. Does this answer your question?

    Jared

    Comment

    Working...