Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2007, 11:31 PM
Authorized User
 
Join Date: Dec 2007
Location: , , Vietnam.
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default Please help me

Everybody.have a good day
Please help me to write page asp.
I have wrote it but not run.Please check my code.Thanks so much to your help.
sendemail.asp:
<%
'+---------------------------------------------
'| Cau hinh o day
host="localhost"
Senderfirstname=Request.Form("firstname")
Senderlastname=Request.Form("lastname")
SenderEmail=Request.Form("email")
Sendertel=Request.Form("phone")
Senderemail=Request.Form("email")
Sendercbxsubject=Request.Form("cbxsubject")
Sendertxtsubject=Request.Form("txtsubject")
Sendernote=Request.Form("note")

'+---------------------------------------------
'Khong chinh sua o duoi neu ban ko biet ve ASP
toname="From website"
toEmail="phuc2583@yahoo.com"
title="Khach hang lien he tu website"
message="<strong>First Name: </strong>"+Senderfirstname+"<br>"
message="<strong>Last Name: </strong>"+Senderlastname+"<br>"
message=message+"<strong>Email: </strong>"+SenderEmail+"</br>"
message=message+"<strong>Sendertel: </strong>"+Sendertel+"<br>"
message=message+"<strong>Name Subject: </strong>"+Sendercbxsubject+"</br>"
message=message+"<strong>Subject: </strong>"+Sendertxtsubject+"<br>"
message=message+"<strong>Note: </strong>"+Sendernote+"<br>"

If Request.Form("sendMail")<>"" and toEmail<>"" Then
    Set Mail = Server.CreateObject("Persits.MailSender")
    Mail.IsHTML=true
    Mail.Host = host
    Mail.From = SenderEmail
    Mail.FromName = SenderfirstName

    Mail.AddAddress toEmail,toname
    If ccEmail<>"" Then
        Mail.AddCC ccemail,ccname
    End If
    If bccEmail<>"" Then
        Mail.AddBcc bccname,bccname
    End If
    If filename<>"" Then
        Mail.AddAttachment filename
    End If
    Mail.Subject=title
    Mail.Body = message
    Mail.Send
    Response.Write("Email Send Success!")
End If
%>

formemail.asp

 <form action="sendemail.asp"name="form" method="post"onsubmit= "return doValidation()">
          <table width="549" border="0" cellspacing="3" cellpadding="0">
                  <tr>
                    <td width="122"><label for="label"><em>First Name</em></label>
:</td>
                    <td width="371"><div align="left">
                      <input name="firstName" type="text" id="firstName" size="40" maxlength="60" />
                    </div></td>
                  </tr>
                  <tr>
                    <td><label for="label"><em>Last Name</em></label>
:</td>
                    <td><div align="left">
                      <input name="lastName" type="text" id="lastName" size="40" maxlength="60" />
                    </div></td>
                  </tr>
                  <tr>
                    <td><label for="label"><em>Phone</em></label></td>
                    <td><div align="left">
                      <input name="Phone" type="text" id="Phone" size="40" maxlength="40" />
                    </div></td>
                  </tr>
                  <tr>
                    <td><label for="label"><em>Email</em></label></td>
                    <td><div align="left">
                      <input name="Email" type="text" id="Email" size="40" maxlength="40" />
                    </div></td>
                  </tr>
                  <tr>
                    <td><label for="label"><em>Subject:</em></label></td>
                    <td><label>
                      <div align="left">
                        <select name="cbxsubject" id="cbxsubject">
                          <option value="Contact">Contact </option>
                          <option value="Booking">Booking</option>
                          <option value="Other">Other</option>
                          <option value="Feedback">Feed back</option>
                        </select>
                        <input name="txtsubject" type="text" id="txtsubject" size="40" maxlength="50" />
                        <br />
                      </div>
                    </label></td>
                  </tr>
                  <tr>
                    <td><em>Comments:</em></td>
                    <td><textarea name="note" id="note" cols="50" rows="5"></textarea></td>
                  </tr>
                  <%elseif id="thanks" then %>
                  <tr>
                    <td></td>
                    <td>&nbsp;</td>
                  </tr>

                  <tr>
                    <td>&nbsp;</td>
                    <td><strong>Thank's for your contact</strong> </td>
                  </tr>
                <%end if%>
                </table>
    <p>
                  <input name="sendMail" type="submit" id="sendMail" value=" Send email " />

                  <input type="reset" name="cancel" id="cancel" value=" Reset " />
                   <input name="hd" type="hidden" value="1" size="2" >
              </p>
            </form>










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.