Same ASP page executed 2 ways produce different results...strange

B

Benman

Hi everyone,

I was looking for a way to execute an .ASP page through the windows
scehduler, and I found several posts that showed out to "run" a URL
using a windows scripting file. The file looks like this:

test1.vbs
-------------
set x=createobject("microsoft.xmlhttp")
x.Open "GET", "http://www.mydomain.com/schedEnding.asp?aid=4", False
x.Send
msgbox("Verastar East Ending - " & x.responseText)
set x=nothing


I successfully scheduled this script in Windows and it runs on time and
does what the .asp page should - with one exception - it does not send
the notifcation email out.

If I open up a browser and type in that exact URL, the page works fine
and it sends the email as designed.

When it runs through the above script in the scheduler, all the
database updates are performed properly, but the emails aren't sent.
How can this be?

Im assuming that in both instances, the page is being invoked under the
security context of the anonymous IUSR_MachineName account, but maybe
this is not the case?

Anyone else have any thoughts on what might be happening here?

Here is the code in the .asp page that sends the emails:

'Now create and send results email
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Admin"
Mailer.FromAddress= "(e-mail address removed)"
Mailer.RemoteHost = "mail.mydomain.com"
Mailer.AddRecipient "Customer", "(e-mail address removed)"
Mailer.Subject = auct("Name") & " Ending Results.."
Mailer.BodyText = mbody
Mailer.ContentType = "text/html"
if Mailer.SendMail then
Response.Write "Form information submitted..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing


As a final note, the resulting message after the scheduled job is
executed, is "Form Information submitted...", which indicates that the
Mailer.SendMail conditional above was successful (no errors).

Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top