Below is some Classic Asp VB Script that i am trying to alter so i can get it to run on my windows 2012 server. (I know its old don't ask :( ). This worked on our old 2003 box but the library it use to use is not supported in 2012. I am now using a stored procedure to send out this e-mail. The problem i am facing is that when i concatenate the sMailBody
string i must have some ' or "
syntax that is not allowing it to concatenate. When I Response.Write(strRSs)
I get the string but all of the HTML renders.
EXEC [dbo].[MailPackage] 'test@test.com', 'tteesstt@ttessttt.com', 'tset' {visible HTML}
for x = 0 to uBound(aRecipientID)
'-- Plugin real content
sMailBody = Replace(sMailBody,"{*~BACKGROUND~*}","'"Session("LiveURL")&"")
sMailBody = Replace(sMailBody,"{*~HEADER~*}",Session("LiveURL")&"images/testing.jpg")
sMailBody = Replace(sMailBody,"{*~BODY~*}",sBody)
sMailBody = Replace(sMailBody,"{*~URL~*}",Session("LiveURL") & "/viewpackage.asp?p=" & sPackageKey & "&u=" & aRecipientID(x) & "&s=" & nSendID&"'")
Dim strRS
strRS = "EXEC [dbo].[MailPackage] " + "'" + aRecipientEmail(x) + "', '" + Session("FromAddress") + "', '" + sSubject + "', '" + sMailBody + "'"
Response.Write(sMailBody)
Response.Write(strRS)
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Session("ConnectionString")
Conn.Execute strRS
How can i correct my syntax so i can pass sMailBody
as my message body into my stored procedure.