TUTORIALS
Authentication Overview
"Tell A Friend" website referral email tool
Password Protecting Content
Integrating Online Credit Card Clearing
Cookie Based Authentication
First we will create the front end form. We just want a nice form where web visitors can recommend your website, by submitting both their , and their friend’s, contact information. I’ve kept this simple , but you can make it as complicated as you like…since we are just passing variables. Include radio buttons, drop down menus, check boxes, even animated gifs and banner ads…whatever you heart desires.
Get EMail
Our web visitor has already filled out our online form, recommending the website to the friend.
This page will grab that information (from the POST),
and using ocxQmail from Flicks Software (www.flicks.com)
we will send the recommendation on behalf of the web visitor.
Cut and paste the following into an .asp page, making the necessary modifications
(instructions are commented for your convenience).
You will need to save the page as sendemail.asp
(or change the POST information of the preceding page to
match whatever you name this next .asp page).
Here is the back end script, that interacts with ocxQmail.
You can actually use OCXmail, which is a free component from Flicks Software, but I prefer ocxQmail.
ocxQmail not only allows you to send automated mail from your website,
but you can “queue” the mail so that it doesn’t slow down your .asp pages.
Also, you can create automated follow up mails
(which I like to use as part of my 'guerrilla’ marketing campaigns).
You can see an example of the Follow UP mail 'in action’ below.
'Remember, you will need ocxQmail to run this program
'You can get ocxQmail at www.flicks.com
'This sets up ocxQmail.
<%
Set mailer = Server.CreateObject("ocxQmail.ocxQmailCtrl.1")
'Set mailer = Server.CreateObject("ASPMAIL.ASPMailCtrl.1")
'use this if you are using ocxmail instead.
%>
'Set the following variables (mailserver, priority,
'return receipt) based on how you have created the previous form.
<%
mailServer = "mail.yourserver.com"
fromName = Request.QueryString("fromname")
fromAddress = Request.QueryString("fromAddress")
productname= Request.QueryString("productname")
'priority = "Low"
returnReceipt = ""
recipient = Request.QueryString("recipient")
' this makes sure the user has not typed in obvious garbage for an email address
result = mailer.PreScreenEmailAddress(recipient)
If "" <> result Then
response.Write("Email address is not ok, because the email address " & result)
response.End
End if
'Set the following variables (uncomment those that you want to use, of course!)
toAddressList = recipient
'ccAddressList = "partners@yourwebsite.com" ' optional
'bccAddressList = "youremail@yourwebsite.com"
' optional - useful if you want to secretly see your stuff being emailed out
'attachmentList = "z:\zip\addurl.zip" ' not often used in this context
'By using ocxQmail, we can send multiple emails any time in the future.
'To do this, we set 'whentosend' as the variable. If we want to send it
'next week, whenToSend = now + 7 . If we want to send it in 12 hours
'then whenToSend = now + 1/2
whenToSend = now ' one day divided by 24 divided by 10 - Six Minutes time
mailer.SendAt(whenToSend)
'messageSubject sets the subject of the email
messageSubject = "Recommendation from " & from Name & _
'CHANGE THE MESSAGE TEXT (messageText) BELOW :)
' we construct the message here so you can see it
' we could just as easily pull it out of a file
' using CreateObject("Scripting.FileSystemObject")
messageText = "Hello, " & vbCRLF & vbCRLF
messageText = messageText & "Your friend " & fromName _
& " recently visited our website" & vbCRLF
messageText = messageText & "and thought that our product " _
& productname & " might interest you." & vbCRLF
messageText = messageText & "You can find full details about " _
& productname & " at www.flicks.com." & vbCRLF
messageText = messageText & _
"If you have any questions, please feel free to contact me directly. " _
& vbCRLF & vbCRLF
messageText = messageText & "Warm Regards, " & vbCRLF & vbCRLF
messageText = messageText & "YOUR NAME " & vbCRLF
messageText = messageText & "YOUR EMAIL" & vbCRLF
'Here, ocxQmail collects the information we have gathered,
'and readies it for sending! If 'you are not going to use
'one of the variables (for instance, attachmentList),
'don’t worry. 'If you do not account for it, neither will ocxQmail.
result = mailer.Q(mailServer, _
fromName, _
fromAddress, _
priority, _
returnReceipt, _
toAddressList, _
ccAddressList, _
bccAddressList, _
attachmentList, _
messageSubject, _
messageText)
'Place your response message here (below)
'or use this for OCXMail
'result = mailer.SendMail(mailserver, recipient, sender, subject, message)
'response.Write("
Sent mail, scheduled for " & whenToSend & "
Message is
" & messageText & "")
'Use This format is f you want to send another
'mail to the same person, later on (with 'FollowUp Mail)
whenToSend = now + (1/120) ' one day divided by 24 divided by 5 - Twelve Minutes time
mailer.SendAt(whenToSend)
messageSubject = "Widget Expiration Alert!"
' we construct the message here so you can see it
' we could just as easily pull it out of a file
' using CreateObject("Scripting.FileSystemObject")
messageText = "Dear " & recipient & "," & vbCRLF & vbCRLF & _
"Warning - your Widget trial version is due" & vbCRLF & _
"to expire tomorrow. You'll want to avoid the " & vbCRLF & _
"inconvenience of interrupted service. Now is the " & vbCRLF & _
"time to take advantage of our purchase Special Offer." & vbCRLF & _
"" & vbCRLF & _
"TIP O' THE DAY - TIP-O-MATIC" & vbCRLF & _
"=====================================================" & vbCRLF & _
"Another great tip!" & vbCRLF & _
"" & vbCRLF & _
"SPECIAL OFFER" & vbCRLF & _
"=====================================================" & vbCRLF & _
"When you purchase THE WIDGET for peanuts, plus " & vbCRLF & _
"$115.95 shipping and handling, we will include a free hat." & vbCRLF & _
"" & vbCRLF & _
"EASY PURCHASE" & vbCRLF & _
"=====================================================" & vbCRLF & _
"1) Visit https://orang-utang.widget.com/weborders/promo/promo2.htm" & vbCRLF & _
"" & vbCRLF & _
"Thanks again for choosing Data Widget and " & vbCRLF & _
"Universal Widget Co." & vbCRLF & _
"" & vbCRLF & _
"Mr John Reed Universal" & vbCRLF & _
"Universal Widget Co." & vbCRLF
result = mailer.Q(mailServer, _
fromName, _
fromAddress, _
priority, _
returnReceipt, _
toAddressList, _
ccAddressList, _
bccAddressList, _
attachmentList, _
messageSubject, _
messageText)
' response.Write("
Sent mail, scheduled for " & whenToSend & "
Message is
" & messageText & "
")
'You can add as many FollowUp Mails as you like.
'Just make sure they are at different 'time intervals.
%>
<%If "" = result Then %>
Please check your mail
<%Else %>
Mail was not queued, error message is
<%= result %>
<%End If %>
Flicks Software.