Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi Frenz,

 

I have been grappling with this problem for long. I am using ASP.Net with C# as codebehind. Much has been talked abt this in this forum and lots of explanations. I unsuccessfully tried implementing the earlier solutions for this problem in this forum.

 

My problem is I am not able to send a mail through my default SMTP Server. The error I encounter is �Could not access CDO.Message object�. Even though I am using �System.Web.Mail.MailMessage�, the error message indicates that .Net platform still implements CDO's COM object libraries for mail messaging.

But the intriguing factor is I am able to send the mail when I use the MS Exchange Server �<servername>� for the same code. However my requirement is to use the �localhost�.

 

I have done the following:

1. My default SMTP Server is running.

2. My ASPNET user has been granted operator permissions for the SMTP Server.

3. I also tried giving the connection control and relay parameters. It didn�t work with it either.

4. I also gave my SmtpMail.SmtpServer = �localhost� or �127.0.0.1�, it didn�t work with it also.

5. My DHCP is enabled.

6. I also gave the Ms Ex Server as my smarthost in IIS and �localhost� as my SmtpMail.SmtpServer. It works in this case but this is not the solution I require.

 

I haven't tried giving the ASPNet user Read/write permissions to the mailroot directory in InetPub as I haven't got really how to do it. (right-click properties is not the one I guess to do this). Pointers on how to do this would be very helpful.

 

 

The log trace indicates that my SMTP server is refusing connections, is returning a 50X error (504 Relay Restricted, etc), or something similar. (I am not sure about this)

 

What I want to know is that is there some external restriction being placed in my domain like blocking port 25 used by my SMTP server so as to restrict this usage (just deducing from the problem � a possibility) or is there some property I have to set in the Properties of the SMTP Server in IIS to send the mail?

 

My �Fully Qualified Domain Name� is set to �<pc-id>.<domain>� e.g. us123.ab.xyz.com. Should I also set something in the �SmartHost� or should �Authentication� be changed�?

 

If anyone has worked on this before, please give a solution for this. I understand that something simple is amiss, but I can�t understand what it is.

 

This is the log trace I receive for the error:

 

Exception Information:

 

System.Web.HttpException: Could not access 'CDO.Message' object. --->

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server.

 

--- End of inner exception stack trace ---

at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)

at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)

at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)

at System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args)

at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)

--- End of inner exception stack trace ---

at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)

at System.Web.Mail.CdoSysHelper.Send(MailMessage message)

at System.Web.Mail.SmtpMail.Send(MailMessage message)

at <form>.btSubmit_ServerClick(Object sender, EventArgs e) in c:\<path>\<filename>.aspx.cs:line 215

 

 

Amicalement,

Neutrino.

 

"Life grows when shared".

Posted

Yep tried that too. It gave me the following error:

 

System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid.

 

Amicalement,

Neutrino

Posted

I've been most recently programming in Vb.net and haven't looked at C# code in a while so it's not fresh on my mind. But in any event - I used this line in VB and it worked.

 

objMail = Server.CreateObject("CDONTS.NewMail")

 

Then just setup the properties and call .send() - hope this helps,

 

DiscoStoo

Posted

It has got nothing to do with your code.

 

I had written a complete email service class, and it worked perfectly on the laptop i was using.

 

Now i've taken the complete programme on my pc at home, with IIS and .NET 1.0 on it. And it doesn't work.

 

The reason, seems to be that SMTP is not working properly!!

I've read that i need to reinstall it, but i don't know how to reinstall the SMTP stuff without uninstalling IIS?!

 

Can someone help me?

Posted

Hi Frenz!

 

I dont think u can reinstall the SMTP stuff alone. U got to reinstall the IIS also. Guyz but tell me if the IIS is re-installed do we have to reinstall the VS.Net too? Pls correct me if I am wrong??

 

With regard to my problem Gertie, I think there is some security restriction. I havent got it sorted it out. But it looks like that way. Just check up with urs.

 

Amicalement,

Neutrino

Posted

for what its worth - Heres what I did to get mine working

 

under the 'access' tab in virtual smtp server properties

 

'connection is set to 'all computers except the list below' with the list being blank

 

under 'relay' i have 'only the ilst below' and added my ip address '192.168.0.2'

 

I think that was all.

 

but yeah from your error it sounds like you need to adjust those relay settings.

You can not get ye flask.
  • 2 months later...
Posted
I am copying my finds I posted elsewhere. I think I know what is going on. You need to download the latest exchange servicepack and replace the cdoex.dll in the C:\Program Files\Common Files\Microsoft Shared\CDO directory. I had version 6.0.4641.0 and it would not work and gave me the same message that it gave you. I Downloaded the service pack 3 for exchange and extracted it. It will not let you install it unless you have Exchange Server 2000 so you have to grab the file manually. Once you are at that point, the dll is going to be in use so you will have to shut down to safe mode. Replace the file and reboot. The new version of the file should be 6.0.6249.1 then it should work or at least mine did after I did that. I hope that helps someone out there who is having this problem.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...