System.Web.Mail problem

G

Goran Djuranovic

Hi all,
When sending mail from within a windows service I get this exception:
"The specified procedure could not be found"
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Web.Mail.CdoSysHelper.Send(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
 
W

Walter Wang [MSFT]

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.Arguments(0)
VTo=WScript.Arguments(1)
VSubject=WScript.Arguments(2)
VBody=WScript.Arguments(3)
VSMTPServer=WScript.Arguments(4)

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = VSubject
objMessage.Sender = VFrom
objMessage.To = VTo
objMessage.TextBody = VBody


objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/sendusing") = 2

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserver") = VSMTPServer

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserverport") = 25
objMessage.Configuration.Fields.Update

objMessage.Send
wscript.echo "Message sent"

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

cscript.exe SendCdosysMail.vbs "(e-mail address removed)" "(e-mail address removed)"
"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
http://support.microsoft.com/kb/301202

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 ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
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/subscriptions/support/default.aspx.
==================================================

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

Goran Djuranovic

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
 

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

Top