%@LANGUAGE="VBSCRIPT"%>
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_IACCDA_STRING
'MM_IACCDA_STRING = "Provider=SQLOLEDB;Initial Catalog=IADA_CC_DB;Data Source=192.168.1.15;Persist Security Info=True;User ID=iaccdadw5929;Password=7sYywwm~lovt"
'MM_IACCDA_STRING = "Provider=SQLOLEDB;Initial Catalog=IADA_CC_DB;Data Source=192.168.1.15;Persist Security Info=True;User ID=iaccdadw5929;Password=7sYywwm~lovt"
MM_IACCDA_STRING = Application("MM_IACCDA_STRING")
%>
<%
Function SendMail(strFrom, strTo, strSubject, strBody)
Dim objMail
Dim intErr
Dim SendOK
'On Error Resume Next
' Bad email
If chkEmail(strFrom) = 1 Then
SendMail = False
Exit Function
End If
' Bad email
If chkEmail(strTo) = 1 Then
SendMail = False
Exit Function
End If
'--- Create an instance of the ASPMail SMTP objMail object.
'Set objMail = Server.CreateObject("SMTPsvg.Mailer")
'objMail.FromName = "iada-cc.com"
'objMail.FromAddress = strFrom
'objMail.RemoteHost = "mail.iada-cc.com"
'objMail.AddRecipient strTo, strTo
'objMail.ContentType = "text/html"
'objMail.Subject = strSubject
'objMail.BodyText = strBody
Set objMail = Server.CreateObject("Persits.MailSender")
objMail.FromName = strFrom
objMail.From = strFrom
objMail.AddReplyTo strFrom
objMail.Host = "mail.iada-cc.com"
objMail.Username = "webmail@iada-cc.com"
objMail.Password = "zu@ie6jseKI"
objMail.AddAddress strTo
objMail.Subject = strSubject
objMail.Body = strBody
objMail.IsHTML = True
'on error resume next '## Ignore Errors
objMail.SendToQueue
'If Err <> 0 Then
' SendMail = False
' 'Err_Msg = Err_Msg & "
Your request was not sent due to the following error: " & Err.Description & "
"
'Else
SendMail = True
'End if
'Response.Write objMail.FromName & " "
'Response.Write objMail.FromAddress & " "
'Response.Write objMail.RemoteHost & " "
'Response.Write strTo & " "
'on error resume next '## Ignore Errors
'SendOk = objMail.SendMail
'Response.Write CInt(SendOk) & " "
'If not(SendOk) <> 0 Then
' SendMail = objMail.Response
'Else
' SendMail = True
'End if
'Set objMail = Server.CreateObject("SoftArtisans.SMTPMail")
'--- Set the Remote SMTP Host through which to send the email.
'objMail.RemoteHost = "localhost"
'objMail.FromAddress = strFrom
'objMail.AddRecipient "" , strTo
'objMail.Subject = strSubject
'objMail.HtmlText = strBody
'If objMail.SendMail Then
' SendMail = True
'Else
' SendMail = objMail.response
'End if
'response.write "SMTP Response " & CInt(SendOK) & " "
'Set objMail = CreateObject("CDONTS.NewMail")
'objMail.From = strFrom
'objMail.To = strTo
'objMail.Subject = strSubject
'objMail.BodyFormat = 0
'objMail.MailFormat = 0
'objMail.Body = strBody
'objMail.Send
'If Err.Number = 0 Then
' SendMail = True
'Else
' SendMail = False
'End If
Set objMail = Nothing
End Function
'Check for valid email
function chkEmail(strAddress)
' checks for a vaild email
' returns 1 for invalid addresses
' returns 0 for valid addresses
dim atCnt
chkEmail = 0
' chk length
if len(strAddress) < 5 then
' a@b.c should be the shortest an
' address could be
chkEmail = 1
' chk format
' has at least one "@"
elseif instr(strAddress,"@") = 0 then
chkEmail = 1
' has at least one "."
elseif instr(strAddress,".") = 0 then
chkEmail = 1
' has no more than 3 chars after last "."
elseif len(strAddress) - instrrev(strAddress,".") > 3 then
chkEmail = 1
' has no "_" after the "@"
elseif instr(strAddress,"_") <> 0 and _
instrrev(strAddress,"_") > instrrev(strAddress,"@") then
chkEmail = 1
else
' has only one "@"
atCnt = 0
for i = 1 to len(strAddress)
if mid(strAddress,i,1) = "@" then
atCnt = atCnt + 1
end if
next
if atCnt > 1 then
chkEmail = 1
end if
' chk each char for validity
for i = 1 to len(strAddress)
if not isnumeric(mid(strAddress,i,1)) and _
(lcase(mid(strAddress,i,1)) < "a" or _
lcase(mid(strAddress,i,1)) > "z") and _
mid(strAddress,i,1) <> "_" and _
mid(strAddress,i,1) <> "." and _
mid(strAddress,i,1) <> "@" and _
mid(strAddress,i,1) <> "-" then
chkEmail = 1
end if
next
end if
end function
Sub SendAccountApproved(ID)
Dim Email, Username, Password, FirstName, LastName, Approved
If Not GetMemberEmailInfo(ID, Email, Username, Password, FirstName, LastName, MemberType, Approved) Then
'Response.Write "Member Not Found"
Exit Sub
End If
'Response.Write Email & " " & Username & " " & Password & " " & FirstName & " " & MemberType & " " & Approved
strFrom = Application("RegisterMailTo")
strTo = Email
If Approved Then
strSubject = "IADA-CC " & MemberType & " Membership Accepted"
strBody = "" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& "IADA-CC Membership Information" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& "Your Membership has been accepted and your Member login has been activated
<% If SendResults Then %>
We have sent your login info to <%=(Member.Fields.Item("Email").Value)%>
<% Else %>
We are unable to send your login info to <%=(Member.Fields.Item("Email").Value)%>
due to send error <%= SendResults %>
<% End If %>
<% Else %>
<% End If %>
[an error occurred while processing this directive]