• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 36712
  • Last Modified:

0xC00402C7 This message is a delivery status notification that cannot be delivered.

I have a fresh WWW2003 server that's running websites that need to send email using CDonts.dll.  I've installed the SMTP service and it's running.  However any mail sent through this server gets sent to the badmail directory with the error:

This message is a delivery status notification that cannot be delivered.

Any ideas?
0
tomrwilson
Asked:
tomrwilson
  • 9
  • 9
  • 4
  • +5
2 Solutions
 
jdfultonCommented:
Just FYI 2003 doesn't support CDONTS.DLL anymore.

Here is a good article.

http://www.sitepoint.com/article/1139
0
 
fz2hqsCommented:
Try this

Set objMail = Server.CreateObject("CDO.Message")
With objMail
      .From = Your_From_Address
      .To = Your_To_Address
      .Subject = Your_Subject
      .HTMLBody = Message_Body
      .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
      .Configuration.Fields.Update
      .Send
End With

Set objMail = Nothing
0
 
tomrwilsonAuthor Commented:
This sounds like it will work, I'm trying but my IIS isn't making sense.  More points at Q20816328.  Once that's solved I'll give it a shot.  Thanks!
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tomrwilsonAuthor Commented:
Holy crap...  I went through all of that.  Here's my code:

set oNewMail = server.CreateObject("CDO.Message")

oNewMail.From = sConslutant & " <" & semail & ">"
oNewMail.To = Request.Form("ClientName")
onewmail.Subject = oeventrs("EmailSubject")

oNewMail.HTMLBody = tmpbody ' Previously Contructed
oNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "www"
oNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oNewMail.Configuration.Fields.Update
oNewMail.send

It took a bit, if I used "localhost" it would fail.  Even 'telnet localhost 25' locks up but 'telnet www 25' returns Ready.  Anyways, long story short, the form submits without error and I'm left with the message in the badmail directory unsendable for the following reason:

"This message is a delivery status notification that cannot be delivered."

At least I have the code and DLL right, thanks guys for pointing me there but it's still the same problem unfortunately.
0
 
fz2hqsCommented:
"This message is a delivery status notification that cannot be delivered" Do you get anything else in event viewer ?
0
 
tomrwilsonAuthor Commented:
I don't even get that in event viewer.  There are no errors.  I got the text from the file(s) in the badmail directory.
0
 
jdfultonCommented:
Try replacing your 3 lines of CDO mail configuration with this

oNewMail.Configuration.Fields.Item(cdoSendUsingMethod) = cdoSendUsingPort  
oNewMail.Configuration.Fields.Item(cdoSMTPServer) = "localhost"
oNewMail.Configuration.Fields.Item(cdoSMTPServerPort) = 25  
oNewMail.Configuration.Fields.Item(cdoSMTPAuthenticate) = cdoBasic
0
 
tomrwilsonAuthor Commented:
Tried those, neither worked.  I get different error messages based on what the SMTPServer value is:

www (name of the machine): error '80040211'
localhost: The transport failed to connect to the server.

The mail server is there and responding.  I can 'telnet www 25' and get a Ready response (also on 110).  However, if I configure Outlook Express on that server and try to send a message I get:

"Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: 'localhost', Server: 'localhost', Protocol: SMTP, Port: 25, Secure(SSL): No, Error Number: 0x800CCC0F"

Perhaps I might have better luck getting the mail server to send mail properly?
0
 
tomrwilsonAuthor Commented:
Got it sending mail through OE.  localhost doesn't work, I have to use the machine name 'www'.  So great, I have the suggestions you've made from above, verified the SMTP server can send mail and eliminated any errors the page sends.  Result:

Badmail folder:
"This message is a delivery status notification that cannot be delivered"
*sigh*
0
 
jdfultonCommented:
Where it says localhost you can specify an ip address.  The message above is normal.  I checked our servers and we have it also.
0
 
tomrwilsonAuthor Commented:
Tried an IP address, the message ends up in badmail with the same message.
0
 
jdfultonCommented:
the default setting is either localhost or mydomain.com etc.

So it is working though?
0
 
jdfultonCommented:
You can also look at the Microsoft article KB265527

It shows the correct syntax using the schemas fz2hqs recommended.
0
 
fz2hqsCommented:
In that kbarticle it recomends that you use the machine name in the

oNewMail.Configuration.Fields.Item(cdoSMTPServer) = "localhost"
or
  .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"

line. To quote :

"This error message occurs if the Simple Mail Transfer Protocol (SMTP) configuration field namespace is not typed with the correct letter case. All of the namespaces in the CDOSYS configuration object are case sensitive. "

so localhost (despite my original post) will err.
0
 
tomrwilsonAuthor Commented:
The article you mentioned had some other suggestions like the case of the options and so forth.  Also a different method of populating the config fields so I used that.  The code now looks like this.

set oNewMail = server.CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.configuration")
Set objFields = objConfig.Fields

With objFields
 .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "sql"
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverPort")= 25
 .Item(cdosmtpauthenticate) = cdoBasic
 .Update
End With
[.subject=,.htmlbody=;.send...]

And it's the same (freaking) result.  No errors from the web page, no errors in event viewer and every message attempt in the badmail directory with the same "delivery status notification" error.  The error code (0xC00402C7), when submitted to MSKBase returns 0 results.

I've tried it all...  I've tried solutions from every document on the web I can try; smarthost options, config field options using numbers, different case sybolics, different methods of populating the object, different domains in the smtp domain list, different authentication methods, I've stripped all the delivery restrictions and opened up the mail server with no autientication and I still get exactly the same result every time without exception.

The help I've gotten here has been excellent but I'm at the 'any solution will do' point because this is a live application that has to work "now".  Are there any other 3rd party solutions that will work or anybody I can simply throw money at until it does?  It's that critical now.
0
 
jdfultonCommented:
You can use JMAIL.  It works great.

http://www.dimac.net/

If you need an example let me know.
0
 
fz2hqsCommented:
Are you blacked by any kind of firewall ?
0
 
jdfultonCommented:
Quick question,

Does it give you the same message when you try to send internal or external mail?   Try both if possible.
0
 
tomrwilsonAuthor Commented:
fz2hqs:  No, the firewall is a nifty blue color.  (j/k)  I'm assured the ports are open, and I did deliver 1 message externally yesterday.

But I did try something different...  I used Outlook express on the server (configured for 'localhost') to send an email to my external address and it gave me this NDR (I get NDR's when I use outlook to send):

You do not have permission to send to this recipient.  For assistance, contact your system administrator.
<www2003.mydomain.com #5.7.1 smtp;550 5.7.1 Unable to relay for mypersonal@address.com>

When I send to an internal recipient I get:

The e-mail system was unable to deliver the message, but did not report a specific reason.  Check the address and try again.  If it still fails, contact your system administrator.

POS.  So it's not sending mail with Outlook now.  I don't get the relay message, the SMTP serve is configured with "all except the list below" with a blank list.  Of course the MS KBase is of no help as usual.  I'm goin to give JMail a shot in the meantime.

0
 
jdfultonCommented:
Here is an example.  

'---JMAIL OBJECT FOR EMAIL---

set msg = Server.CreateOBject( "JMail.Message" )
msg.Logging = true
msg.silent = true
msg.From = request("txtReplyto")
msg.FromName = request("txtFrom")
msg.AddRecipient strDomainEmail
msg.Subject = request("txtSubject")
msg.Body = request("txtBody")

'---errorcheck---
            
if not msg.Send(strMailServer) then
Response.Redirect "confirm.asp?mailsent=" & msg.log
            
else
Response.Redirect "confirm.asp?mailsent=true"
end if
0
 
tomrwilsonAuthor Commented:
COOL.  JMail works wonders.  Cripes, what a difference.  Install Microsoft's = 3 days of living hell.  Install something done right, instant success.  Looking at Vb.Net for the first time I asked myself, 'ok, how do I simply read a database record?'  Microsoft's examples go something like this:

"You have a corporation with 5 branch offices that require an accounting system capable of interfacing with multiple outside clients at once.  The database consists of 300 tables all cross-linked using views and stored procedures.  Using a single SQL query (53k long), we return a complete set of accounting records...."

I just wanted to read a record.  Don't even start me on their training for Active Directory.  Anyways, I digress.  Your help was amazing, hopefully my frustration did not come off as disstatisfaction with your efforts.  I've increased and split the points between you for the suggestions involved, despite the fact I couldn't get Microsoft's "better and easier cdonts.dll replacement" working. *sigh*

A big thanks...
0
 
jdfultonCommented:
A big welcome...

Good luck
0
 
mattyhearneCommented:
I have been through all of this iinformation (and much more online) but all of my email is being dumped into the badmail directory. I have tried CDO, AspMail and Jmail but they all do the same thing... dump the mail in the badmail directory. The error code in the text of the badmail directory is 0xC00402C7.

I am at a total loss as to what to do now. Any more information or ideas is greatly appreciated.
0
 
MaryLintzCommented:
I had the same problem and resolved it by configuring the SMTP server with the Smarthost with my compay's email firewall server.  I'm running plan jane CDONTS, but will write new scripts in CDOSYS, as CDONTS is not supported much longer.  Working fine now.

Hope that helps - Mary
0
 
MaryLintzCommented:
One other thing... Tom:  You mention that you are running W2003, wich I am not sure, but may not support the CDONTS.dll anmore.
0
 
xinkunCommented:
0xC00402C7, I also get this error when I try to send to multiple email address which are saperated by ";". any idea why?
0
 
MaryLintzCommented:
I think your issue may be caused by using the semi colon.  I think you need to separate the addresses with a comma.

Best -  Mary
0
 
skinbackCommented:
I had this problem on Windows 2000 server. Re-installing the SMTP service fixed it.

Tim
0
 
orizdidioCommented:
I had a similar error message after moving on another disk the folder c:\Inetpub\mailroot... something like moving on another partition/disk the www or ftp roots.

Re-installing the SMTP service fixed it, only because Win restored the original path...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 9
  • 9
  • 4
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now