You need a JavaScript-enabled browser to view this site.
  Web Hosting Support   Company News
 

ASPMail

Using the ASPMail script is a very straightforward process. All you need do is specify a page on your web site as the "action" page for your form, and then include the ASPMail script on that page.

Each form on your website will consist of 2 pages: A "form" page which actually holds your form, and an "action" page which processes your form when someone clicks on the "submit" button. For purposes of this discussion, we will refer to these pages as "form.html" and "aspmailform.asp". *

*Note: Your action page must have a .asp extension, even though it is an ordinary HTML file.

Once you have constructed your form using regular HTML make sure that your <form> tag specifies the "post" method, and that the action statement points to your "action" page. Example:

<form action="aspmailform.asp" method="post">

Then, on your action page (aspmailform.asp) you will need to add a block of code similar to the one below. The Mailer.RemoteHost line will be "mail.yourdomain.xyz" (where .xyz is your domain extension such as .com). Please note that your domain must be pointing to our service and you must be using our DNS servers for this to work properly.

<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "WebsiteOrAnything"
Mailer.FromAddress= "name@yourdomain.com"
Mailer.RemoteHost = "mail.yourdomain.com"
Mailer.AddRecipient "Name", "name@yourdomain.com"
Mailer.Subject = "Form Submission"
strMsgHeader = "Form information follows" & vbCrLf
for each qryItem in Request.Form
  strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
  Response.Write "Form information submitted..."
else
  Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>

Order your ASPMail Fields

To return form contents in the original form order your code might be...

strMsgHeader = "Form Information Follows: " & vbCrLf
for i = 1 to Request.Form.Count
strMsgInfo = strMsgInfo & Request.Form.Key(i) & " - " & Request.Form.Item(i) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

Note this code only works for forms containing 128 or fewer field items

Sending HTML Emails

To send the body of the email as HTML include this line:
Mailer.ContentType = "text/html"

* This line would need to go above the line:
    if Mailer.SendMail then

ASPQMail

AspQMail uses the AspMail component to send messages to the queue. To use the component you use it the same way you normally would except that you set one additional property.

Mailer.QMessage = true

If QMessage is true then the message will be sent to the \Que directory and queued for delivery. If it is false (the default) it will be sent normally via SMTP. Queuing can greatly increase the response time of your application if you are delivering to several recipients at once.
           

The pertinent lines of this code are explained below:

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

Do not alter this line

Mailer.FromName = "Website"

Optional, this text will appear in the "from" field on the E-mail message that is sent. You may use an E-mail address here.

Mailer.FromAddress = "webmaster@yourdomain.com"

Required: a valid E-mail address from your domain.

Mailer.RemoteHost = "mail.yourdomain.com"

Required: Enter the address of the mail server for your domain.

Mailer.AddRecipient "Domain Webmaster", "webmaster@yourdomain.com"

Required: and in two parts. The first part ("Domain Webmaster") can be any name or an E-mail address. The second part ("webmaster@yourdomain.com") must be a valid E-mail address.

Mailer.Subject = "Form Submission"

This will be the title of your E-mail message.

Do not alter any other line of the code.

 

Flash Games
We've jumped on the Flash games bandwagon and are starting to release some of our games for your enjoyment. We're just getting our feet wet, so the games are starting out simple! Check out our games page to see what's available.

 
Featured Project

Ouray Vacations—Mountain Getaways

Ouray Vacations WebsiteImageAid recently completed and launched the innnagural Web site for OurayVacations.com. The site promotes vacation opportunities and activities in Ouray, Colorado, 'The Switzerland of America.' The site integrates HTML with XML and Flash, creating a usable, dynamically driven site.

In the coming months, we will be launching a PHP- and MySQL-driven property promotion and reservation system. This application will enable local property management firms to easily and efficiently oversee their vacation rentals.

Planning your trip to Ouray, Colorado, is now as easy as visiting www.ourayvacations.com.

 
Search Form

Topic:

Show Page Summaries