Formmail

Discussion in 'HTML / PHP / JavaScript / CSS' started by Sammy, Aug 6, 2014.

  1. Question:
    • Is <script> and <html> in one file?
    • What parameter do I need to specify? <script runat="server"> what is this?
    • Is this similer to the formmail? like <form name="hw555" method="post" onsubmit="return Form_Validator(this)" action="http://www.xxx.net/cgi-bin/formmail.pl">
     
  2. To make a working test from the KB you linked:

    1. Copy and paste the VB.NET or C# code into a new text document, I used Notepad.
    2. Save the text document as a regular text file, choose a suitable name, I used “aspnetMailNoAuth”.
    3. Find the document in your OS’s file explorer and change the extension from “.txt” to “.aspx”.

    Now you will have a “working” test page, before deploying it you will want to adjust the “Dim strFrom =” and “Dim strTo” variables from the VB.NET code sample, or “mail.From =” and “mail.To.Add” from the C# example.
     

    Attached Files:

    mjp likes this.
  3. Thank you. But I still don't understand...
    What do I do after this. Am I suppose to create a form content in this file?
    Or am I suppose to create another html page to point to this .asp file?
    ( like this ..<form name="ManualOrder" method="post" onsubmit="return Form_Validator(this)" action="test.asp">)?

    I tried both, but I'm getting below error.

    Active Server Pages error 'ASP 0221'

    Invalid @ Command directive

    /formmail/test.asp, line 1

    The specified 'Page Language="VB" ' option is unknown or invalid.
     
  4. Wait... I needed to use test.aspx. Now I am getting email when I hit that page. MailMsg.Body = "This is a sample message" by email. Wowooo.

    Now, how can I capture the form input in the email?
    In below, if I want to capture the Address value that user enter in the text box, how can I do ?

    <input type="text" name="Address" value="" size="40" />
     

Share This Page