cdo .message failure

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

OK - I'm very close. I'm running a console app on a server and it fails
with cdo .message failure. It's a simple email routine which works fine on
my development pc. Do you have any idea what would cause this?

Thanks for any help.

Bernie Yaeger
 
If your SmtpMail.SmtpServer = "localhost" you need make sure your sever
allows 127.0.0.1 to relay.

I would check to make sure in IIS under Default SMTP Virtual
Server->Properites->Access->Relay that you have added 127.0.0.1 to that
list.

HTH,
Greg

Greg
 
CDOSYS (I assume that's what you're using there) should be installed on W2K
and above. Are you using it through COM? Why not use System.Web.Mail
instead? It wraps CDOSYS if it is available, otherwise it will use CDONTS.
 
* "Bernie Yaeger said:
OK - I'm very close. I'm running a console app on a server and it fails
with cdo .message failure. It's a simple email routine which works fine on
my development pc. Do you have any idea what would cause this?

I suggest to have a look at this great resource:

<URL:http://www.systemwebmail.net/>
 
Hi Klaus,

But I am using system.web.mail, and on my development machine it works fine,
but on the pc running an exe on a ms small business server it gets the error
'can't access cdo.message object'. Any ideas?

I installed iis on the pc (it was already installed on the server), but that
didn't help.

Tx

Bernie
 
Hi Bernie,

As long as Jay did not send them this are links from him, normally he add ti
this more to the point information when he sees it.

http://www.microeye.com/resources/res_outlookvsnet.htm

http://msdn.microsoft.com/library/d...html/frlrfsystemwebmailsmtpmailclasstopic.asp

http://msdn.microsoft.com/library/d.../cdosys/html/_cdosys_schema_configuration.asp

http://msdn.microsoft.com/library/d...y/en-us/exchanchor/htms/msexchsvr_cdo_top.asp


The four CDOs are (in chronological order):

- CDO.DLL : CDO version 1.2.1
- CDONTS.DLL : CDO version 1.2.1 for Windows NT Server (not the same as CDO
version 1.2.1!)
- CDOSYS.DLL : CDO for Windows 2000
- CDOEX.DLL : CDO for Exchange 2000 Server


I hope this helps a little bit?

Cor
 
Hi Bernie,

OK. What version of Windows is this (the server)?

CDOSYS should be there if this is W2K or higher. However, things also change
depending on whether you're using a direct connection to the SMTP server or
the local pickup service. If the latter then IIS' SMTP server has to be
running.
 
Hi Klaus,

Tx for your continued assistance.

The server is a MS small business server running ms windows 2003 for small
business server.

Let me explain further - the app is running on a pc and it really is not
involved with the server, other than the fact that it is running in one of
the server drives. I am trying to email a file as an attachment. The code
is simple and it works on my development pc. Would it be possible to add
key dlls to my bin sub to solve the problem? Should I register them in the
pc's registry? The PC is xp pro.

Thanks again,

Bernie
 
Hi Bernie,

OK, let's do the following:

- Check that there's a cdosys.dll file in your <Win>\System32 folder. The
version for Win2003 should be 6.5.6747.0.
- Check your code. Are you using a direct connection to the SMTP server, or
are you using the pickup service?
- If you're using the pickup service then the virtual SMTP service in your
dev PC should be running, and it must not be running in the server. If
you're doing a direct connection to the SMTP server then that's not the
problem.
- Can you write a small VBScript or JScript file that sends a message
successfully from the server? That way we'd eliminate CDOSYS itself as the
problem.
 
Hi Klaus,

Yes, cdosys.dll is in the server's windows\system32 sub, and the version is
6.5.6747.0 (checked it in windows explorer/properties). As a point of
information, the version on the pc (xp pro) is different, an older version
(2002).

Could it be that as I run this exe from the command line, that I don't have
sufficient permission to access cdosys?

Bernie


I'm using a direct connection to an smtp server, one of several that I have.
 
When you say "command line" does that mean you're logged into the server,
correct? Are you an admin on it?
 
Hi Klaus,

Well, with your help and others I've pretty much figured it out.

It was a rights issue and a bad smtp server. By 'bad' I mean one that does
not allow relay, and although I don't know why it failed on cdo, it did.
When I changed to 127.0.0.1 (localhost) it worked fine from the command line
(it's a vb .net console app) or via xp_cmdshell inside sql server. The
server has ms exchange installed so it's its own smtp server. This is fine,
as the job is part of an agent job on sql server and it does what it has to
do with no problems (its sending me an attachment log file after it runs).

However, when you try to run from the command line of a pc connected to the
server, the cdo error recurs. Now I think this is because cdosys.dll does
not recognize the user's identity. What do I have to do in the code to
authorize the user so that cdo will allow it to be run from the pc instead
of the server?

Tx for all your help - the above question is somewhat important, though,
because I do not want to have to run an sp script every time I really want
to send mail through vb .net.

Bernie Yaeger
 
Bernie,

Bernie Yaeger said:
However, when you try to run from the command line of a pc connected to the
server, the cdo error recurs. Now I think this is because cdosys.dll does
not recognize the user's identity. What do I have to do in the code to
authorize the user so that cdo will allow it to be run from the pc instead
of the server?

How is the PC "connected" to the server?
 
Hi Klaus,

The pc is a connected to the server using microsoft client for networks on a
win 2003 server system.

Tx - Bernie
 
Hi Bernie,

Bernie Yaeger said:
The pc is a connected to the server using microsoft client for networks on a
win 2003 server system.

OK, we seem to have a bit of miscommunication going on here =)

"Connected" to me means some sort of transport going on between the two
boxes, like DCOM or remoting or something like that. So your console
application has to be "connected" to the server in some way... where exactly
is the EXE that you're running? In the server? You do know that executes it
in your machine, not in the server, right?

I think I'm definitely missing something here, but I can't figure out what.
 
Back
Top