Home     |    Topics 6   |    Forums   |    Hosts/ISPs   |    Jobs     |    Cool Stuff     |    Search     |    Contact
Home
Books
Articles
Components
Examples
Discussions
Links

Tell a friend about this page

 

Using ASPMail to Send Form Contents
From Shawn Jackson
October 22, 1999

This example uses ASPMail from ServerObjects.com to send the entire form contents to a specified person. The fields on the email notice will be in the exact same order as on your form.

<%
If Request.Form.Count > 0 Then
    For I = 1 to Request.Form.Count
        Body = Body & Request.Form.Key(I) & " " _
               & Request.Form.Item(I) & vbCRLF
    Next

    '*** send email notice
    Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    Mailer.RemoteHost    = "your-smtp-server"
    Mailer.FromName      = "Shawn"
    Mailer.FromAddress   = "shawn@actionjackson.com"
    Mailer.AddRecipient "Shawn Jackson", "shawn@actionjackson.com"
    Mailer.Subject       = "New Profile Entered"
    Mailer.BodyText      = Body
    Mailer.SendMail
    Set Mailer = Nothing
    Response.Redirect "thankyou.htm"
End If
%>

<html>
<body>

<form action="<%= Request.ServerVariables("SCRIPT_NAME") %>" method=post>
<table>
    <tr>
        <td>First Name</td>
        <td><input type=text name="FirstName" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Last Name</td>
        <td><input type=text name="LastName" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Company</td>
        <td><input type=text name="Company" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Position</td>
        <td><input type=text name="Position" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Address</td>
        <td><input type=text name="Address" size=30 maxlength=100></td>
    </tr>
    <tr>
        <td>City</td>
        <td><input type=text name="City" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>State/Province</td>
        <td><input type=text name="State" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Zip/Postal Code</td>
        <td><input type=text name="Zip" size=30 maxlength=20></td>
    </tr>
    <tr>
        <td>Country</td>
        <td><input type=text name="Country" size=30 maxlength=50></td>
    </tr>
    <tr>
        <td>Phone</td>
        <td><input type=text name="Phone" size=30 maxlength=30></td>
    </tr>
    <tr>
        <td>Email</td>
        <td><input type=text name="Email" size=30 maxlength=100></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=submit value="Submit"></td>
    </tr>
</table>
</form>

</body>
</html>







Home | ASP | ADSI/WSH | ADO/SQL | DHTML/XML | IIS | VID | Forums | Hosts/ISPs | Jobs | Cool Stuff | Search | Contact
Copyright © 1999, 2000 ActionJackson.com