System.Web.Mail problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Goran Djuranovic

    System.Web.Mail problem

    Hi all,
    When sending mail from within a windows service I get this exception:
    "The specified procedure could not be found"
    at System.RuntimeT ype.CreateInsta nceImpl(Boolean publicOnly)
    at System.Activato r.CreateInstanc e(Type type, Boolean nonPublic)
    at System.Web.Mail .CdoSysHelper.S end(MailMessage message)
    at System.Web.Mail .SmtpMail.Send( MailMessage message)

    It works fine on my development box, but not my other box. Development box is WinXP Pro SP2, "other" box is WinXP Pro SP1.

    Any ideas?
    Thanks
    Goran
  • Walter Wang [MSFT]

    #2
    RE: System.Web.Mail problem

    Hi Goran,

    System.Web.Mail from .NET 1.1 internally uses CDOSYS to send mail. We need
    to first verify that whether CDOSYS works or not.

    Let's create a simple VBScript file, name it as "SendCdosysMail .vbs":

    VFrom=WScript.A rguments(0)
    VTo=WScript.Arg uments(1)
    VSubject=WScrip t.Arguments(2)
    VBody=WScript.A rguments(3)
    VSMTPServer=WSc ript.Arguments( 4)

    Set objMessage = CreateObject("C DO.Message")
    objMessage.Subj ect = VSubject
    objMessage.Send er = VFrom
    objMessage.To = VTo
    objMessage.Text Body = VBody


    objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
    guration/sendusing") = 2

    objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
    guration/smtpserver") = VSMTPServer

    objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
    guration/smtpserverport" ) = 25
    objMessage.Conf iguration.Field s.Update

    objMessage.Send
    wscript.echo "Message sent"

    Then try to run this script on your "other box" with following command:

    cscript.exe SendCdosysMail. vbs "from@email.com " "to@email.c om"
    "subject" "body" "localhost"

    Please tell me the result or exact error message it displays.

    From several reported cases of this error message, it seems related to
    corrupt MDAC installation; you may need to repair or reinstall MDAC:

    #How to check for MDAC version


    By the way, if you're using .NET 2.0, it's recommended to use
    System.Net.Mail ; for more info, please refer to
    http://www.systemwebmail.com and http://www.systemnetmail.com

    Sincerely,
    Walter Wang (wawang@online. microsoft.com, remove 'online.')
    Microsoft Online Community Support

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

    ications. If you are using Outlook Express, please make sure you clear the
    check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
    promptly.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.
    =============== =============== =============== =====

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • Goran Djuranovic

      #3
      Re: System.Web.Mail problem

      Hi Walter,
      My SMTP service was messed up. I figured out, after a number of unsuccessful
      tries of re-installation of SMTP service (I was getting some weird COM error
      messages), I would "repair" Windows. After that I re-installed SMTP service
      successfully, and everything worked fine. I did try running your script
      afterwards and it worked fine.

      Thanks
      Goran


      "Walter Wang [MSFT]" <wawang@online. microsoft.comwr ote in message
      news:8Tlbd262GH A.3440@TK2MSFTN GXA01.phx.gbl.. .
      Hi Goran,
      >
      System.Web.Mail from .NET 1.1 internally uses CDOSYS to send mail. We need
      to first verify that whether CDOSYS works or not.
      >
      Let's create a simple VBScript file, name it as "SendCdosysMail .vbs":
      >
      VFrom=WScript.A rguments(0)
      VTo=WScript.Arg uments(1)
      VSubject=WScrip t.Arguments(2)
      VBody=WScript.A rguments(3)
      VSMTPServer=WSc ript.Arguments( 4)
      >
      Set objMessage = CreateObject("C DO.Message")
      objMessage.Subj ect = VSubject
      objMessage.Send er = VFrom
      objMessage.To = VTo
      objMessage.Text Body = VBody
      >
      >
      objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
      guration/sendusing") = 2
      >
      objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
      guration/smtpserver") = VSMTPServer
      >
      objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/confi
      guration/smtpserverport" ) = 25
      objMessage.Conf iguration.Field s.Update
      >
      objMessage.Send
      wscript.echo "Message sent"
      >
      Then try to run this script on your "other box" with following command:
      >
      cscript.exe SendCdosysMail. vbs "from@email.com " "to@email.c om"
      "subject" "body" "localhost"
      >
      Please tell me the result or exact error message it displays.
      >
      From several reported cases of this error message, it seems related to
      corrupt MDAC installation; you may need to repair or reinstall MDAC:
      >
      #How to check for MDAC version

      >
      By the way, if you're using .NET 2.0, it's recommended to use
      System.Net.Mail ; for more info, please refer to
      http://www.systemwebmail.com and http://www.systemnetmail.com
      >
      Sincerely,
      Walter Wang (wawang@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support
      >
      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

      ications. If you are using Outlook Express, please make sure you clear the
      check box "Tools/Options/Read: Get 300 headers at a time" to see your
      reply
      promptly.
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      =============== =============== =============== =====
      >
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >

      Comment

      Working...