<% Set rsKbSearch = Server.CreateObject("ADODB.RecordSet") SearchSql="SELECT * FROM tbl_KbIndex WHERE ID=" & aID rsKbSearch.Open SearchSql,cString If Request.QueryString("message") <> "emailSent" AND Request.QueryString("step") = "2" Then strFromName = Request.Form("YourName") strFromEmail = Request.Form("YourEmail") strRecipientsEmail = Request.Form("RecipientsEmail") strRecipientsName = Request.Form("RecipientsName") strSubject = Request.Form("Subject") strMessage = "Hello, " & strRecipientsName & "! Your friend " & strFromName & " has sent you the following message:" & vbCrLf & vbCrLf & Request.Form("Message") & vbCrLf & vbCrLf & _ "You may be interested in this article: " & homePage & "viewarticle.asp?aID=" & aID & vbCrLf & vbCrLf & _ "Best regards," & vbCrLf & _ pageTitle & " Webmaster. " & adminEmail Dim emptyValue If strFromName = "" OR strFromEmail = "" OR strRecipientsEmail = "" OR strRecipientsName = "" Then emptyValue = True Else emptyValue = False End If If emptyValue = False Then Select Case LCase(strMailMode) Case "aspemail" Set objNewMail = Server.CreateObject("Persits.MailSender") objNewMail.Host = strMailServer objNewMail.FromName = strFromName objNewMail.AddReplyTo strFromEmail objNewMail.From = strFromEmail objNewMail.AddAddress strRecipientsEmail, strRecipientsName objNewMail.Subject = strSubject objNewMail.Body = strMessage on error resume next '## Ignore Errors objNewMail.Send If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if Case "aspmail" Set objNewMail = Server.CreateObject("SMTPsvg.Mailer") objNewMail.FromName = strFromName objNewMail.FromAddress = strFromEmail 'objNewMail.AddReplyTo = strFromEmail objNewMail.RemoteHost = strMailServer objNewMail.AddRecipient strRecipientsName, strRecipientsEmail objNewMail.Subject = strSubject objNewMail.BodyText = strMessage on error resume next '## Ignore Errors SendOk = objNewMail.SendMail If not(SendOk) <> 0 Then Err_Msg = Err_Msg & "
  • Your request was not sent due to the following error: " & objNewMail.Response & "
  • " End if Case "cdonts" Set objNewMail = Server.CreateObject ("CDONTS.NewMail") objNewMail.BodyFormat = 1 objNewMail.MailFormat = 0 on error resume next '## Ignore Errors objNewMail.Send strFromEmail, strRecipientsEmail, strSubject, strMessage If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if on error resume next '## Ignore Errors Case "chilicdonts" Set objNewMail = Server.CreateObject ("CDONTS.NewMail") on error resume next '## Ignore Errors objNewMail.Host = strMailServer objNewMail.To = strRecipientsEmail objNewMail.From = strFromEmail objNewMail.Subject = strSubject objNewMail.Body = strMessage objNewMail.Send If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if on error resume next '## Ignore Errors Case "jmail" Set objNewMail = Server.CreateObject("Jmail.smtpmail") objNewMail.ServerAddress = strMailServer objNewMail.AddRecipient strRecipientsEmail objNewMail.Sender = strFromEmail objNewMail.Subject = strSubject objNewMail.body = strMessage objNewMail.priority = 3 on error resume next '## Ignore Errors objNewMail.execute If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if Case "jmail4" Set objNewMail = Server.CreateObject("Jmail.Message") 'objNewMail.MailServerUserName = "myUserName" 'objNewMail.MailServerPassword = "MyPassword" objNewMail.From = strFromEmail objNewMail.FromName = strFromName objNewMail.AddRecipient strRecipientsEmail, strRecipientsName objNewMail.Subject = strSubject objNewMail.Body = strMessage on error resume next '## Ignore Errors objNewMail.Send(strMailServer) If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if Case "smtp" Set objNewMail = Server.CreateObject("SmtpMail.SmtpMail.1") objNewMail.MailServer = strMailServer objNewMail.Recipients = strRecipientsEmail objNewMail.Sender = strFromEmail objNewMail.Subject = strSubject objNewMail.Message = strMessage on error resume next '## Ignore Errors objNewMail.SendMail2 If Err <> 0 Then Err_Msg = Err_Msg & "
  • Your email was not sent due to the following error: " & Err.Description & "
  • " End if End Select Set objNewMail = Nothing On Error Goto 0 %> <% Set rsAdmin = Server.CreateObject("ADODB.RecordSet") AdminSql="SELECT * FROM tbl_Admin" rsAdmin.Open AdminSql,cString %> <%=pageTitle%> - Knowledge Base Search - Email Article: Mail Sent <% Server.Execute("inc_style.asp") %>

    " alt="<%=pageTitle%>">

    Thank you!  An email has just been sent to <%=strRecipientsName%> regarding the article <%=Replace(rsKbSearch("articleTitle"), "''", "'")%>.

    Click here to close this window

    <% rsAdmin.Close Set rsAdmin = Nothing %> <% End If ElseIf Request.QueryString("message") <> "emailSent" Then %> <%=pageTitle%> - Knowledge Base Search - Email Article <% Server.Execute("inc_style.asp") %> <% If emptyValue = True Then %>

    Several of the required fields were left empty, and are marked in red.  Please make the necessary changes.

    <% End If %>
    ">

    Email article to a friend

    <%If strYourName = "" AND emptyValue = True Then Response.Write("") End If%>Your Name<%If strYourName = "" Then Response.Write("") End If%>:
    <%If strYourEmail = "" AND emptyValue = True Then Response.Write("") End If%>Your Email Address<%If strYourEmail = "" Then Response.Write("") End If%>:
    <%If strRecipientsName = "" AND emptyValue = True Then Response.Write("") End If%>Recipient's Name<%If strRecipientsName = "" Then Response.Write("") End If%>:
    <%If strRecipientsEmail = "" AND emptyValue = True Then Response.Write("") End If%>Recipient's Email Address<%If strRecipientsEmail = "" Then Response.Write("") End If%>:
    Message:

    <% Else %> <%=pageTitle%> - Knowledge Base Search - Email Article: Error <% Server.Execute("inc_style.asp") %>

    An unknown error has occurred.  Please try again later.

    Click here to close this window

    <% End If rsKbSearch.Close Set rsKbSearch = Nothing %>