close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

STARTTLS in classic asp

Thread began 3/16/2021 12:54 pm by sharon39426 | Last modified 3/22/2021 1:58 pm by sharon39426 | 32 views | 5 replies

sharon39426

<%
dim gBodyFormat, gOneToAddress
gBodyFormat = ""
gOneToAddress = false

function WAUE_AddAttachment(mailObj,attPath)
if (WAUE_isAttachment(attPath)) then
mailObj.AddAttachment attPath
end if
set WAUE_AddAttachment = mailObj
end function

function WAUE_SetCharset(mailObj,charSet)
mailObj.CharSet = charSet
set WAUE_SetCharset = mailObj
end function

function WAUE_AddBCC(mailObj,bccEmail)
if (bccEmail <> "") then
emailArr = Split(cStr(bccEmail), ";")
for bcc=0 to UBound(emailArr)
if (InStr(cStr(emailArr(bcc)), "@")) then
emailArr2 = Split(cStr(emailArr(bcc)), "|WA|")
if (UBound(emailArr2) = 0) then
if (WAUE_isEmailAddress(emailArr(bcc))) then
mailObj.AddBCC WA_StripSpaces(cStr(emailArr(bcc)))
end if
else
if (InStr(emailArr2(1), "@")) then
if (WAUE_isEmailAddress(emailArr2(1))) then
mailObj.AddBCC WA_StripSpaces(emailArr2(1)), WA_TrimLeadingSpaces(emailArr2(0))
end if
else
if (WAUE_isEmailAddress(emailArr2(0))) then
mailObj.AddBCC WA_StripSpaces(emailArr2(0)), WA_TrimLeadingSpaces(emailArr2(1))
end if
end if
end if
end if
next
end if

set WAUE_AddBCC = mailObj
end function

function WAUE_AddCC(mailObj,ccEmail)
if (ccEmail <> "") then
emailArr = Split(cStr(ccEmail), ";")
for cc=0 to UBound(emailArr)
if (InStr(cStr(emailArr(cc)), "@")) then
emailArr2 = Split(cStr(emailArr(cc)), "|WA|")
if (UBound(emailArr2) = 0) then
if (WAUE_isEmailAddress(emailArr(cc))) then
mailObj.AddCC WA_StripSpaces(cStr(emailArr(cc)))
end if
else
if (InStr(emailArr2(1), "@")) then
if (WAUE_isEmailAddress(emailArr2(1))) then
mailObj.AddCC WA_StripSpaces(emailArr2(1)), WA_TrimLeadingSpaces(emailArr2(0))
end if
else
if (WAUE_isEmailAddress(emailArr2(0))) then
mailObj.AddCC WA_StripSpaces(emailArr2(0)), WA_TrimLeadingSpaces(emailArr2(1))
end if
end if
end if
end if
next
end if

set WAUE_AddCC = mailObj
end function

function WAUE_AddRecipient(mailObj,recEmail)
if (recEmail <> "") then
emailArr = Split(cStr(recEmail), ";")
for rec=0 to UBound(emailArr)
if (InStr(cStr(emailArr(rec)), "@")) then
emailArr2 = Split(cStr(emailArr(rec)), "|WA|")
if (UBound(emailArr2) = 0) then
if (WAUE_isEmailAddress(emailArr(rec))) then
mailObj.AddAddress WA_StripSpaces(cStr(emailArr(rec)))
gOneToAddress = true
end if
else
if (InStr(emailArr2(1), "@")) then
if (WAUE_isEmailAddress(emailArr2(1))) then
mailObj.AddAddress WA_StripSpaces(emailArr2(1)), WA_TrimLeadingSpaces(emailArr2(0))
gOneToAddress = true
end if
else
if (WAUE_isEmailAddress(emailArr2(0))) then
mailObj.AddAddress WA_StripSpaces(emailArr2(0)), WA_TrimLeadingSpaces(emailArr2(1))
gOneToAddress = true
end if
end if
end if
end if
next
end if

set WAUE_AddRecipient = mailObj
end function

function WAUE_BodyFormat(mailObj,bodyFormat)
if (bodyFormat = 0 OR bodyFormat = 2) then
mailObj.IsHTML = true
end if

gBodyFormat = bodyFormat

set WAUE_BodyFormat = mailObj
end function

function WAUE_Definition(remHost,port,login,pword)
set retVal = Server.CreateObject("Persits.MailSender")
retVal.Host = remHost

if (port <> "") then
retVal.Port = cInt(port)
end if

if (login <> "") then
retVal.UserName = login
retVal.Password = pword
end if
gOneToAddress = false
set WAUE_Definition = retVal
end function

function WAUE_SendMail(mailObj,mailAttachments,mailBCC,mailCC,mailTo,mailImportance,mailFrom,mailSubject,mailBody)
if (gOneToAddress) then
if (InStr(mailFrom, "|WA|")) then
dim mailFromArr
mailFromArr = Split(mailFrom, "|WA|")
for f=0 to UBound(mailFromArr)
if (InStr(cStr(mailFromArr(f)), "@")) then
mailObj.From = mailFromArr(f)
else
mailObj.FromName = mailFromArr(f)
end if
next
else
mailObj.From = mailFrom
end if

if (gBodyFormat = 2) then
mailBodyArray = Split(mailBody, "<multipartbreak>")
mailBody = mailBodyArray(1)
mailObj.AltBody = mailBodyArray(0)
end if
mailObj.Body = mailBody

mailObj.Subject = mailSubject

mailObj.Send()
end if
set WAUE_SendMail = mailObj
end function

function WAUE_SetImportance(mailObj,Importance)
dim newPriority
newPriority = 3
if (NOT IsNumeric(Importance)) then
if (UCase(Importance) = "HIGH") then
newPriority = 1
end if
if (UCase(Importance) = "LOW") then
newPriority = 5
end if
else
newPriority = cInt(Importance)
end if

mailObj.Priority = newPriority
set WAUE_SetImportance = mailObj
end function%>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...