![]() |
||||||||
|
<%
Dim strTo, strSubject, strBody 'Strings for recipient, subject, body
Dim objCDOMail 'The CDO object
strTo = Request.Form("to")
strSubject = Request.Form("subject")
strBody = Request.Form("body")
strBody = strBody & vbCrLf & vbCrLf
strBody = strBody & "--"
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("name")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("email")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("address")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("city") & ", " & Request.Form("state") & Request.Form("zip")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("phone_area") & "-" & Request.Form("phone_number")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("workphone_area") & "-" & Request.Form("workphone_number") & "ext" & Request.Form("workphone_ext")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "- - - - - - - - - - - -"
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "PRESCRIPTION INFORMATION"
strBody = strBody & "Prescription:" & Request.Form("prescription")
strBody = strBody & vbCrLf
strBody = strBody & "Strength:" & Request.Form("prescription_strength")
strBody = strBody & vbCrLf
strBody = strBody & "Dose:" & Request.Form("prescription_dose")
strBody = strBody & vbCrLf
strBody = strBody & "Quantity:" & Request.Form("prescription_quantity")
strBody = strBody & vbCrLf
strBody = strBody & "Last Pharmacy Filled At:" & Request.Form("prescription_lastpharmacy")
strBody = strBody & vbCrLf
strBody = strBody & "Refill Information:" & Request.Form("prescription_refill")
strBody = strBody & vbCrLf
strBody = strBody & "Fill at Pharmacy:" & Request.Form("prescription_pharmacy")
strBody = strBody & vbCrLf
strBody = strBody & "Second Choice:" & Request.Form("prescription_second")
strBody = strBody & vbCrLf
strBody = strBody & Request.Form("comments")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
If strTo = "" Or Not IsValidEmail(strTo) Then
%> Please Note: You must be a current COA patient to use this form.
<% Else Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = "COA Refills Your prescription has been successfully submitted! " End If ' End page logic %> <% ' Only functions and subs follow! ' A quick email syntax checker. It's not perfect, ' but it's quick and easy and will catch most of ' the bad addresses than people type in. Function IsValidEmail(strEmail) Dim bIsValid bIsValid = True If Len(strEmail) < 5 Then bIsValid = False Else If Instr(1, strEmail, " ") <> 0 Then bIsValid = False Else If InStr(1, strEmail, "@", 1) < 2 Then bIsValid = False Else If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then bIsValid = False End If End If End If End If IsValidEmail = bIsValid End Function %> |
||||||||