Dundas | Dundas Email Component Script by ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

ASP Scripts

Dundas

Dundas is yet another mail component that works well for send form data via email.

The first thing you need to do is create a formpage.asp page with the code below:

<form name="YourFormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Subject: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comments: </td>
<td><textarea name="Comments"></textarea></td>
</table>
<input type="submit" name="Submit" value="Submit Form">
</form>

Next, we create a confirmation.asp page and enter the code as seen below:

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
strEmail = Request.Form("Email")
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
strSubject = Request.Form("Subject")
strComments = Request.Form("Comments")

DIM objMailer
intSubscribers = 0
DO WHILE NOT objRSs.EOF
Set objMailer = Server.CreateObject ("Dundas.Mailer")
strSubscriber = objRSs("fSubscriber")
objMailer.SMTPRelayServers.Add = strMailHost
objMailer.FromAddress = strEmail
objMailer.FromName = strFromName
objMailer.TOs.Add strToName & "<" & strSubscriber & ">"
objMailer.Subject = strSubject
objMailer.Body = strComments
objMailer.SendMail
Set objMailer = Nothing
%>

Now you have a complete form that sends data to an email address and displays a customized message for your user. The default for Dundas like the other mail components we cover is to send text messages. If you want to send HTML messages you can simply include this extra line of code before the objMailer.Body line.

objMailer.ContentType = "text/html"

Enjoy!

< Back to ASP Scripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
10 May 2008