Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

SMTP - All mails going to Badmail folder IIS



2:36 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Need some help here, for some reason my IIS setup sends all emails from my php scripts to the Badmail folder, i've had it setup before and working, I followed the same procedure as I had done before but no joy at all, if anyone can help me here that would be great


Receptional Andy

2:40 pm on Dec 1, 2005 (gmt 0)

Along with each email, there should be a file containing an error report. What error is it you have in thse files?


3:10 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

the .BAD File:

From: postmaster@FIC
To: developer@example.com
Date: Thu, 1 Dec 2005 14:34:09 +0000
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
Message-ID: <FRaqbC8wS00000001@fic>
Subject: Delivery Status Notification (Failure)

This is a MIME-formatted message.
Portions of this message may be unreadable without a MIME-capable mail program.

Content-Type: text/plain; charset=unicode-1-1-utf-7

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.


Content-Type: message/delivery-status

Reporting-MTA: dns;fic
Received-From-MTA: dns;FIC
Arrival-Date: Thu, 1 Dec 2005 14:34:09 +0000

Final-Recipient: rfc822;example@example2.com
Action: failed
Status: 5.0.0

Content-Type: message/rfc822

Received: from FIC ([]) by fic with Microsoft SMTPSVC(5.0.2195.6713);
Thu, 1 Dec 2005 14:34:09 +0000
Date: Thu, 01 Dec 2005 14:34:09 +0000
Subject: Comments
To: example@example2.com
From: example@example2.com <example@example2.com>
Return-Path: example@example2.com
Reply-To: example@example2.com
Message-ID: <FICEQv2ooskTMxtUkFI00000001@fic>
X-OriginalArrivalTime: 01 Dec 2005 14:34:09.0309 (UTC) FILETIME=[4A546CD0:01C5F684]

Name: phil

Email: example@example2.com

Comments: hello



The .BDR File:

Unable to deliver this message because the follow error was encountered: "This message is a delivery status notification that cannot be delivered.".

The specific error code was 0xC00402C7.

The message sender was <>.

The message was intended for the following recipients.

The .BDP File comes up with some funky stuff, let me know if you want that aswel.


NOTE: i changed the SMTP port manualy to 26 and edited the php.ini file to suit the new port.

[edited by: physics at 6:14 am (utc) on Dec. 2, 2005]
[edit reason] No specific domains please. Examplified. [/edit]

Receptional Andy

3:23 pm on Dec 1, 2005 (gmt 0)

The message sender was <>.

Check that your script is specified a valid sender for the emails.


3:42 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

The sender is getting set both in the php.ini file and the script its self, not sure if that causes a conflict? Again it is getting set but its not being passed through to the email, ill keep trying.

Receptional Andy

4:05 pm on Dec 1, 2005 (gmt 0)

How is your script set up to send the email? Wherever it is specifying the sender, try using something simple like

$headers = 'From: me@localdomain.tld'

You could also try adding valid emails into X-Receiver and X-Sender headers.


4:24 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Ok i've had a tinker with IIS after uninstalling and installing it, yet again... I changed the relay settings to allow, and also allowed for anonymous access, so now my mails are getting to the queue folder, and thats it, very stationary from there lol :¦

Also, in the IIS management panel the smpt server now shows the status of unknown and i cant view the sessions as it thinks its not running.

Summary, the script works, the emails going through just not being sent any more ideas?

x-sender? Can you tell me some more about this as im not to great with headers.


Receptional Andy

4:30 pm on Dec 1, 2005 (gmt 0)

Ok i've had a tinker with IIS after uninstalling and installing it, yet again


You seem to have a separate problem now, which is that SMTP isn't working - this means everything will wait in the queue folder until SMTP collects it (it may well end up back in badmail once SMTP is running).

Try going to 'administrative tools >>services' and restarting SMTP services manually, and check the event log for related errors.

relay settings to allow, and also allowed for anonymous access

Hope this server isn't accessible from the internet ;)


4:31 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Can you resolve to your destination domains?

Sounds like a resolution problem.


4:34 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

its just a dev server only on the net via network.

I've checked a few errors and it said something about not being able to resolve gmail.com (this is the correct domain for the sender email) Restarting now to see what the crack is if any...

I know if i upload the script to the actual webhosts server for the site it will work as i did it the other day, i just need to get it to work locally so i can work offline and avoid using a remote server for testing :¦

Receptional Andy

4:36 pm on Dec 1, 2005 (gmt 0)

Can you resolve the DNS for gmail manually? Try pinging gmail.com.


4:40 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

no problems resolving the server unless google have have stopped using gmail.com for googlemail.com? Machines just :¦ booting up now ill see what the errors are if any...


4:46 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Ok so SMTP server status shows up fine now, no new errors in event view and just sent another email from the script and its stuck in the Queue directory again.

Played ping pong with gmail.com via command (cmd) line window and was sucessful...

So... tricky one aye

Questions: I wouldn't need that dodgy messenger service running (win2k) for smtp to work correctly (I dont think so on this one but need to ask as i always disable this service)

One other thing, as im using apache for my webserver ive changed the port of the iis webserver to 8080 and stopped it from running, would this cause an issue? I hasn't in the past when ive had it all working but again might aswel ask...


5:02 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Changed the to field from



email@domain.com <email@domain.com>

and just comes back with an error, mails still trapped in the queue folder not sure whats going on, no errors in the error viewer...

Any more help would be great


6:22 pm on Dec 1, 2005 (gmt 0)

10+ Year Member

Check you DNS settings, if its allocated by DHCP, try setting it manually.

I did an install of IIS SMTP to test, and I am facing no issue at all.

Receptional Andy

9:31 am on Dec 2, 2005 (gmt 0)

You could also try conncting to the IIS mail server manually via telnet, and seeing what error (if any) it gives you when you try to send an email:

>>telnet fic 26

220 FIC Microsoft ESMT
830 ready at Fri, 2 Dec 2005 09:24:56 +0000 MAIL Service, Version: 6.0.3790.1

>>HELO me.localdomain

250 FIC Hello []

>>MAIL FROM: example@example2.com

250 2.1.0 example@example2.com....Sender OK

>>RCPT TO: example2@example2.com

250 2.1.5 example2@example2.com


354 Start mail input; end with <CRLF>.<CRLF>

>>Just a test

250 2.6.0 <FIClncFLoRne2043062b@FIC> Queued mail f
or delivery


221 2.0.0 FIC Service closing transmission channel


Featured Threads

Hot Threads This Week

Hot Threads This Month