473,769 Members | 7,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Sep 18 '06 #1
2 2085
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 "fr**@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
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.comwr ote in message
news:8T******** ******@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 "fr**@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
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
8674
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 spreadsheet attachment per message, seems to be causing som kind of corruption of the attachment, while several spreadsheets per works just fine. Consider the following three snippets of C# code:
3
3273
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 = "W-MyPcName.mycompany.com"; mail.To=strTo; mail.Cc=strCC; mail.Bcc=strBCC;
5
2237
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 this class that will send email, however my class will not seem to recognise the system.web.mail.mailmessage. my first impression on this is that I may have to use some sort of third
1
8182
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 the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
2
3499
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 application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net Framework v1.1 SP1. The code worked fine under W2K SP4.
2
4532
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 from using system.web.mail to system.net.mail (of course vs is telling me system.web.mail is obsolete). In .Net 1.1, the files deleted with no problem but in .Net 2 when I attempt to delete I receive The process cannot access the file ...'...
2
4321
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 instatiates a new MailMessage object (see below) My form has the following code: Imports System.Net.Mail Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
2
2808
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. The following code is being executed on the server to send e-mails to clients (.NET Framework 1.1): .... EmailsInQueCollection eqc = GetUnsentEmails();
1
3279
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 error below, If I disable SSL and use port 587 all goes well. I have been Googling for 2 days without success and this seems to be a common problem.
5
8331
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 by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: for the permission of type
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.