Solved

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

Posted on 2003-12-03
29
36,397 Views
Last Modified: 2012-08-14
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
Comment
Question by:tomrwilson
  • 9
  • 9
  • 4
  • +5
29 Comments
 
LVL 6

Expert Comment

by:jdfulton
ID: 9871222
Just FYI 2003 doesn't support CDONTS.DLL anymore.

Here is a good article.

http://www.sitepoint.com/article/1139
0
 
LVL 9

Assisted Solution

by:fz2hqs
fz2hqs earned 150 total points
ID: 9873115
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
 

Author Comment

by:tomrwilson
ID: 9874491
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
 

Author Comment

by:tomrwilson
ID: 9875793
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
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9876053
"This message is a delivery status notification that cannot be delivered" Do you get anything else in event viewer ?
0
 

Author Comment

by:tomrwilson
ID: 9876521
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
 
LVL 6

Expert Comment

by:jdfulton
ID: 9876553
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
 

Author Comment

by:tomrwilson
ID: 9876953
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
 

Author Comment

by:tomrwilson
ID: 9877048
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
 
LVL 6

Expert Comment

by:jdfulton
ID: 9877321
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
 

Author Comment

by:tomrwilson
ID: 9877392
Tried an IP address, the message ends up in badmail with the same message.
0
 
LVL 6

Expert Comment

by:jdfulton
ID: 9877927
the default setting is either localhost or mydomain.com etc.

So it is working though?
0
 
LVL 6

Expert Comment

by:jdfulton
ID: 9877975
You can also look at the Microsoft article KB265527

It shows the correct syntax using the schemas fz2hqs recommended.
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9881045
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:tomrwilson
ID: 9882902
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
 
LVL 6

Accepted Solution

by:
jdfulton earned 150 total points
ID: 9882956
You can use JMAIL.  It works great.

http://www.dimac.net/

If you need an example let me know.
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9883017
Are you blacked by any kind of firewall ?
0
 
LVL 6

Expert Comment

by:jdfulton
ID: 9883025
Quick question,

Does it give you the same message when you try to send internal or external mail?   Try both if possible.
0
 

Author Comment

by:tomrwilson
ID: 9883432
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
 
LVL 6

Expert Comment

by:jdfulton
ID: 9883660
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
 

Author Comment

by:tomrwilson
ID: 9883817
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
 
LVL 6

Expert Comment

by:jdfulton
ID: 9883922
A big welcome...

Good luck
0
 

Expert Comment

by:mattyhearne
ID: 10669145
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
 

Expert Comment

by:MaryLintz
ID: 10689856
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
 

Expert Comment

by:MaryLintz
ID: 10689872
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
 

Expert Comment

by:xinkun
ID: 10714858
0xC00402C7, I also get this error when I try to send to multiple email address which are saperated by ";". any idea why?
0
 

Expert Comment

by:MaryLintz
ID: 10728867
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
 

Expert Comment

by:skinback
ID: 11180869
I had this problem on Windows 2000 server. Re-installing the SMTP service fixed it.

Tim
0
 

Expert Comment

by:orizdidio
ID: 12371638
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now