473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

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.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
Sep 18 '06 #1
2 2061
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 "fr**@email.com" "to@email.com"
"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 (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

Sep 19 '06 #2
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]" <wa****@online.microsoft.comwrote in message
news:8T**************@TK2MSFTNGXA01.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.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 "fr**@email.com" "to@email.com"
"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 (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

Sep 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
2
by: Brad | last post by:
I have a web .Net app which sends emails with attachments. After the email is sent I clean up aftermyself and delete the attachments from disk. In upgrading to .Net 2 I changed the email logic...
2
by: Tim | last post by:
I am trying to send a simple mail message using windows forms in VB.NET 2005. When executing the code, I get a general 'Configuration system failed to initialize' error message when the code...
2
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. ...
1
by: WIzmanG | last post by:
Hi all I am having trouble with sending email via a C#2.0 application, I use the same settings as I use in Outlook but I cannot get email to send. I am trying to use SSL on port 465 and get the...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.