0

我想在我的网站上创建一个表单,如果用户填写并发送它,那么我会收到包含他的数据的确认电子邮件。我知道如何通过 PHP 做到这一点,但我只能使用 ASP,而且我不熟悉 ASP。感谢您的建议和帮助。所以我的表格是这样的:

                  <tr>
                    <td>*First Name: </td>
                    <td colspan="3"><input type="text" name="FirstName" required  id="field"/></td>
                  </tr>

                  <tr>
                    <td>*Last Name: </td>
                    <td colspan="3"><input type="text" name="LastName" required id="field" /></td>
                  </tr>

                  <tr>
                    <td>Company: </td>
                    <td colspan="3"><input type="text" name="Company" id="field" /></td>
                  </tr>

                  <tr>
                    <td>*Address: </td>
                    <td colspan="3"><input type="text" name="Address" required id="field" /></td>
                  </tr>

                  <tr>
                    <td align="left">*City: </td>
                    <td colspan="3"><input type="text" name="City" required id="field" /></td>
                  </tr>

                  <tr>
                    <td align="left">*State: </td>
                    <td colspan="3"><input type="text" name="State" required id="field" /></td>
                  </tr>

                  <tr>
                    <td align="left">*Zip Code: </td>
                    <td colspan="3"><input type="text" name="ZipCode" required id="field" /></td>
                  </tr>

                  <tr>
                    <td align="left">*Phone: </td>
                    <td><input type="text" name="lastname" required id="field" /></td>
                    <td>&nbsp;&nbsp;&nbsp;Ext. </td>
                    <td><input type="text" name="Extension" id="field-extensions"/></td>
                  </tr>

                  <tr>
                    <td align="left">Fax: </td>
                    <td><input type="text" name="Fax" id="field" /></td>
                  </tr>

                  <tr>
                    <td align="left">*Email: </td>
                    <td><input type="email" name="Email" required id="field" /></td>
                  </tr>

                  <tr>
                    <td colspan="4" align="left"><br /><br />Comments:<br />
                    <textarea rows="10" cols="120" id="field-comments" name="Comments"> </textarea><br />                      
                    <button type="submit" id="sub-button">Submit</button></td>                       
                  </tr>

                </table>

           </form>
4

1 回答 1

2

假设您在您的表单中使用 Post 方法:在目标(操作页面)中

请执行下列操作

<%
Dim name, lastName, Company, Address, City
name = Request.Form("FirstName")
lastName= Request.Form("LastName")
Company= Request.Form("Company")
Address= Request.Form("Address")
City= Request.Form("City")
.....


Set myMail=CreateObject("CDO.Message")
myMail.Subject="user Iformation"
myMail.From="mymail@mydomain.com"
myMail.To="yourselef@somedomain.com"
myMail.TextBody="user information "& name & "lastName: " & lastName & .....(rest of params)
myMail.Send
set myMail=nothing

%>

问候

于 2013-05-23T21:36:18.937 回答