HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web archive/conferencesearch (old) (to delete)/HBOS/inc-email.asp
<%
' NOT TO BE TOUCHED BY SOCK (JEETS)'
'Option Explicit ' (SS,21/1/05) removed because in inc-main.asp
Dim NL
NL = Chr(13) + Chr(10)
Dim FEmailType, FPlainTextHeadingSpaces, FBody, FTableStyle
FEmailType = "HTML" ' can be set to also be set to "PLAIN" '
FPlainTextHeadingSpaces = 0
FTableStyle = _
"td {" &_
"font-family: Verdana, Arial, Helvetica, sans-serif;" &_
"font-size: 10px;" &_
"border-top-width: 1px;" &_
"border-right-width: 1px;" &_
"border-bottom-width: 1px;" &_
"border-left-width: 1px;" &_
"border-bottom-style: solid;" &_
"border-top-color: #CCCCCC;" &_
"border-right-color: #CCCCCC;" &_
"border-bottom-color: #CCCCCC;" &_
"border-left-color: #CCCCCC;" &_
"vertical-align: top;" &_
"}"

Sub SetTableStyle(ATableStyle)
  FTableStyle = ATableStyle
End Sub

Sub OpenEmail(AType, APlainTextHeadingSpaces)
  FBody = ""
  FEmailType = AType
  FPlainTextHeadingSpaces = APlainTextHeadingSpaces
  If FEmailType = "HTML" Then
    FBody = FBody & "<html>" & NL & "<head>" & NL
    FBody = FBody & "<style type=""text/css"">" & NL & "<!--" & FTableStyle & "-->" & NL & "</style>" & NL
    FBody = FBody & "</head><body>" & NL
    FBody = FBody & "<table>" & NL
  End If
End Sub

Sub AddToEmail(AHeading, AValue)
  If FEmailType = "HTML" Then
    FBody = FBody & NL & "<tr>" & NL
    FBody = FBody & "<td>" & "<b>" & AHeading & "</b>" & "</td>" & NL
    FBody = FBody & "<td>" & "<b>" & Replace(AValue, NL, "<br>") & "&nbsp;" & "</b>" & "</td>" & NL
    FBody = FBody & "</tr>" & NL
  Else
    If Len(AHeading) >= FPlainTextHeadingSpaces Then
      FBody = FBody & AHeading
    Else
      FBody = FBody & Left(AHeading & Space(FPlainTextHeadingSpaces), FPlainTextHeadingSpaces)
    End If
    FBody = FBody & ": " & AValue & NL
  End If
End Sub

Sub CloseEmail
  If FEmailType = "HTML" Then
    FBody = FBody & NL & "</table>" & NL
    FBody = FBody & "</body>" & NL & "</html>"
  End If
End Sub

' (SS,21/1/05) renamed from SendEmail to SendEmailNow because SendEmail exists in AppUtils
Sub SendEmailNow(ASubject, ATo, ABcc1, ABcc2, AFrom)
  CloseEmail ' close the table tags etc because OpenEmail would have been called '

  ' send the email using Dundas Mailer Control '
  Dim objEmail ' Mailer control '
  Set objEmail = Server.CreateObject("Dundas.Mailer")
  objEmail.SMTPRelayServers.Add "mail.itpartnership.com"

  ' set Mailer control properties and collection items '
  objEmail.TOs.Add ATo
  If ABcc1 <> "" Then objEmail.BCCs.Add ABcc1
  If ABcc2 <> "" Then objEmail.BCCs.Add ABcc2
  objEmail.FromAddress = AFrom
  objEmail.Subject = ASubject
  If FEmailType = "HTML" Then
    objEmail.HTMLBody = FBody
  Else
    objEmail.Body = FBody
  End If

  objEmail.SendMail
  ' you can test for the success/failure of the operation by examining VBScripts Err object here '
  Set objEmail = Nothing
End Sub
%>