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

Discussion in 'ASP General' started by Benman, Dec 9, 2005.

  1. Benman

    Benman Guest

    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= ""
    Mailer.RemoteHost = "mail.mydomain.com"
    Mailer.AddRecipient "Customer", ""
    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.
     
    Benman, Dec 9, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    495
    Luc The Perverse
    Oct 27, 2006
  2. Billy
    Replies:
    2
    Views:
    441
    Billy
    Jan 30, 2007
  3. Googy
    Replies:
    1
    Views:
    140
    Robert Klemme
    Jan 26, 2007
  4. HmJ
    Replies:
    0
    Views:
    263
  5. Replies:
    2
    Views:
    132
    Eric Pozharski
    Mar 3, 2009
Loading...

Share This Page