Hi Everyone,
I recently ran into a problem that other ASP developers have come across when trying to make use of MSXML2.ServerXMLHTTP. What I am trying to do is have my site read a page --
with arguments passed -- and then make that page the body of an e-mail.
Here's my code
vb Code:
qpos = instr(myURL,"?")
if qpos > 0 then
'If there is a ?, it means there are arguments so do this
base_url = "http://" & mid(myURL,1,qpos-1) 'the URL without args
args = mid(myURL,qpos+1) 'The rest of the args
'Make the call...
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", base_url, false
xmlhttp.send args
myMail.HTMLBody = xmlhttp.responseText
set xmlhttp = nothing
else
myMail.CreateMHTMLBody myURL 'Get the body from this page...no args
end if
The problem, from what I've read, centers around the functionality of MSXML2.ServerXMLHTTP which prevents it from being used to connect to its own address. So, I can read the contents of other site's pages, but not my own.
I need this ability since the pages are not just used as e-mail content, they are pages that people look at directly from time to time so I'd like to use those pages rather than have two sets of display code for the output.
Can anyone suggest a workaround for me or let me know what I'm doing wrong?
Thanks!