Tuesday, 29 November 2011

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:

Email:
First Name:
Last Name:
Subject:
Comments:


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
http://www.aspwebpro.com/aspscripts/email/dundas.asp

No comments:

Post a Comment