ASP Sample Codes:

Display Current Date/Time
Send Email

 

From: 
To: 
Subject:
Message:

Click Send once to send the message.

  


  1. Use Insert, Form, Form to insert a form;
  2. Use Insert, Form, One Line Text Box to insert the frmFrom input field, right click the text box, select Form Field Properties, type frmFrom in the Name box as shown in the picture below: 

  1. Use Insert, Form, One Line Text Box to insert the frmTo input field, right click the text box, select Form Field Properties, type frmTo in the Name box; 
  2. Use Insert, Form, One Line Text Box to insert the frmSubject input field, right click the text box, select Form Field Properties, type frmSubject in the Name box;
  3. Use Insert, Form, Scrolling Text Box to insert the frmMessage input field, right click the text box, select Form Field Properties, type frmMessage in the Name box; 
  4. Right click the form, select Form Properties, then click Send to other as shown in the picture below:

 

  1. Then click the Options, type sendmail.asp in the Action field.

  1. Then create a file named "sendmail.asp" with the following code:

<%@ Language=VBScript %>

<%

strFrom = Request.Form("frmFrom")

strTo = Request.Form("frmTo")  

strSubject = Request.Form("frmSubject")

strMessage = Request.Form("frmMessage")

Response.Write "Sending email to: <B>" & strTo & "</B> .. "

Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.To = strTo

objMail.From = strFrom

objMail.Value("Reply-To") = strFrom

objMail.Subject = strSubject

objMail.Body = strMessage

objMail.Send

Set objMail = Nothing

Response.Write "done"

%>

 

 
| members | | shared hosting | | tech support | | contact | | Jobs |

Copyright ©1999 - 2002  AtFreeWeb.com, Inc. All rights reserved.