Problems using Server.CreateObject - Help required

Results 1 to 4 of 4

Thread: Problems using Server.CreateObject - Help required

  1. #1
    Jane Fothergill Guest

    Default Problems using Server.CreateObject - Help required

    I&#039ve got the following bit of code which just isn&#039t behaving:<BR><BR>if Session("Error_found") = True then<BR> Response.Write ("Error_found = true")<BR> <BR> &#039ASPExchange.dll call<BR> m = Server.Createobject("ASPExchange.Mail")<BR> Response.Write ("Object created")<BR> Response.Write m.debuginfo<BR> Response.Write err.description<BR> Response.Write ("Object ASPExchange.Mail created")<BR> m.Server = "UKZ024"<BR><BR> m.Subject = "Subject"<BR> m.Text="Message contents"<BR> m.AddRecipient "me@my.com"<BR> <BR> if m.Send = False then<BR> response.write "Failed To Send Message"<BR> response.write m.errormessage & "<BR>"<BR> response.end<BR> end if<BR> Response.Write ("Message Sent")<BR> end if<BR><BR>Now, the object ASPExchange.Mail DOES exist. The output I get from running this bit of code is:<BR> Error_found = true<BR>That&#039s it. I don&#039t get any "unable to create object" type messages, and I don&#039t get any of the other responses.<BR>If I replace the ASPExchange.Mail with say, JANE, which is an object which does not and never has existed I get exactly the same outcome.<BR><BR>Has anybody got any bright ideas what&#039s occurring?<BR>Do I need some sort of privilege to do a Server.CreateObject that I might be missing? <BR><BR>Cheers<BR>Jane

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Problems using Server.CreateObject - Help required

    I think when u r creating the object<BR>u will have to say<BR><BR>Set m = Server.Createobject("ASPExchange.Mail")<BR><BR>Not ice the "Set"<BR><BR>Manish

  3. #3
    Jane Fothergill Guest

    Default RE: Problems using Server.CreateObject - Help required

    It doesn&#039t seem to make much difference, I&#039ve tried with<BR>Set m =<BR>and with<BR>dim m<BR>m = <BR><BR>Neither gives any response.<BR><BR>Jane

  4. #4
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Problems using Server.CreateObject - Help required

    I just tried running ur code.<BR><BR>Now the statement for creating the object will be executed<BR>only if Your session varibale Error_found = True.<BR><BR>I gave the following statement just before ur code and it started<BR>giving error messages<BR><BR>Session("Error_found") = True<BR><BR>But I dont know where u r setting the session variable.<BR>Since that variable is not True ur code is not getting <BR>executed.<BR><BR>Manish<BR><BR><BR>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •