SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2000
    Location
    Houston TX
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need to e-mail a submission form to myself from my site.
    It needs to include text boxes for Name Address State e-mail
    Phone Number etc. Thanks in advance!!!!
    I will have to add the other text boxes, but let us assume there are three more boxes Name, Address, Phone#
    Thank you!!!!

    Here is the code: :-)



    <%


    Dim BodyToSend, Message


    If Request.Form("SendButton") <> "Send" or Request.Form("bodytext") = "" Then
    %>

    <html>
    <head>
    <title>Suggestions </title>
    </head>
    <body>

    <!-- This ASP code line automatically inserts
    the path and file name of this page. -->
    <form method="POST" action="<%=Request.ServerVariables("URL")%>">

    <P align=center style="LINE-HEIGHT: 100%; MARGIN-TOP: -15px">&nbsp;</P>
    <P align=center style="LINE-HEIGHT: 100%; MARGIN-TOP: -15px">&nbsp;</P>
    <P align=center style="LINE-HEIGHT: 100%; MARGIN-TOP: -15px"><B><FONT
    color=#0000ff face=Arial size=5>ICG INC</FONT></B></P>
    <P align=center style="line-height: 100%; margin-top: -10px"><FONT color=#0000ff
    face=Arial size=4>REQUEST FOR INFORMATION</FONT></P>
    <P align=center style="LINE-HEIGHT: 100%; MARGIN-TOP: -15px">&nbsp;</P>
    <p align="center" style="line-height: 100%; margin-top: -15px"><font face="Arial" color="#0000FF"></font></p>
    <p align="center" style="line-height: 100%; margin-top: -15px"><br>
    </p>
    <div align="center">
    <table border="1" width="410" height="341" bordercolor="#FFFFFF" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="410" height="341" align="left">
    <div align="center">
    <center>
    <table border="1" width="348" height="61" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
    <tr>
    <td width="348" height="61"><font color="#000000" face="Arial"></font>
    <p><font color="#000000" face="Arial">Please be assured that any information you give
    us will not be sold to any third parties.</font></td>
    </tr>
    </table>
    </center>
    </div>
    <p align="left">

    Please enter your email addressbr>

    <input type="text" name="email" size="50" maxwidth="50" maxlength="50">

    <br><br>

    Please enter any suggestions you may have for our Site<br>
    in the box below.<br>

    <textarea name="bodytext" cols="40" rows="6">
    </textarea>

    <br><br>

    <input type="submit" value="Send" name="SendButton">
    <input type="reset" value="Clear" name="ClearButton">

    </p>

    <center>
    <p><a href="">HOME</a></td>
    </tr>
    </table>
    </div>

    </form>

    </body>
    </html>

    <%


    Else

    '*** Create the message object.
    Set Message = CreateObject("CDONTS.NewMail")

    '*** Set the from, to, and
    '*** subject fields.
    Message.From = Request.Form("email")
    Message.To = "mross@ev1.net"
    Message.Subject = "Suggestions"

    '*** Add any additional informtion
    '*** you want to the message text.
    BodyToSend = Request.Form("bodytext") & vbcrlf & _
    " " & vbCRLF & _
    "***From the Suggestions page of ICG INC***"

    '*** Set the altered body text.
    Message.Body = BodyToSend

    '*** If there is an error,
    '*** continue with the script.
    On Error Resume Next

    '*** Send the email message.
    Message.Send

    '*** If sending the message caused
    '*** an error, then display the
    '*** message, else display a
    '*** success message (or redirect
    '*** to a different page).
    If Err.Number = 0 Then
    Response.redirect "http://.htm"
    Else
    Response.Write "Error: " & Err.Description
    End If

    '*** Clear out the message variable
    Set Message = Nothing

    '*** End of If for checking
    '*** SendButton and message
    '*** to send.
    End If

    %>





  2. #2
    SitePoint Member
    Join Date
    Dec 2000
    Location
    California
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what's the problem?
    you just want someone to add the other fields to the CDONTS (email)?

    I'll use the following field names:
    name, address, email, city, state, zip, phone, bodytext
    Code:
    <% 
    If Request.Form("SendButton") <> "Send" or Request.Form("bodytext") = "" Then 
      '
      ' I'll let you build the HTML
      '
    Else 
    
    Set Message = CreateObject("CDONTS.NewMail") 
    
    BodyToSend = Request.Form("name") & vbcrlf & _
      " has submited the following info:" & vbcrlf & vbcrlf & _
      "    Address: " & Request.Form("address") & vbcrlf & _
      "       City: " & Request.Form("city") & vbcrlf & _
      "      State: " & Request.Form("state") & vbcrlf & _
      "   Zip Code: " & Request.Form("zip") & vbcrlf & _
      "      Phone: " & Request.Form("phone") & vbcrlf & _
      "     E-Mail: " & Request.Form("email") & vbcrlf & vbcrlf & _
      "Suggestions:" & vbcrlf & Request.Form("bodytext")
    
    Message.From = Request.Form("email") 
    Message.To = "mross@ev1.net" 
    Message.Subject = "Suggestions" 
    Message.Body = BodyToSend 
    
    On Error Resume Next 
    
    Message.Send 
    
    If Err.Number = 0 Then 
      Response.redirect "http://.htm" 
    Else 
      Response.Write "Error: " & Err.Description 
    End If 
    
    Set Message = Nothing 
    
    End If 'Request.Form("SendButton") <> "Send" or Request.Form("bodytext") = ""
    
    %>
    your email will looks something like this:
    Code:
    Max Albert has submited the following info:
        Address: 123 Abc St.
           City: Holywood
          State: Ca
       Zip Code: 90210
          Phone: 555-555-5555
         E-Mail: 123@b.com
    
    Suggestions:
    This is a really kuel emailer!
    Good Luck,


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •