Thanks so much for your continued assistance, bg.
Not crazy about the subnet idea because it would be quite easy for someone else to randomly get an amazon compute instance in such a subnet. Given the complexity of the PHP/mail stack, SPF is starting to look increasingly attractive.
PHP seems to only care about the SMTP setting in the PHP.ini file and does not appear to use the IIS setting at all. For example, I set SMTP to localhost on port 25 and this script echoes OK:
<?php
if(mail('me@mydomain.com','test subject','test message')){
echo('ok');
}else{
echo('not ok');
}
?>
I imagine it isn't using the IIS SMTP settings because I have intentionally set the IIS SMTP settings to a server which does not exist. If I set the IIS credentials to some valid domain with proper credentials the testemail.php script still returns OK, the mail logs on the remote SMTP server never register any login attempt, and the mail does not arrive for most domains, although we have gotten one mail through this way. I believe 'localhost' will actually send an email out to the target domain and its' the SPF that's preventing delivery.
If I change the value for SMTP inside PHP.ini to some broken/non-existent server or some server that requires authentication, I get 'NOT OK' from my script.
What is not clear at all is how mail gets sent when I set the SMTP value in PHP.ini to 'localhost/port 25'. As you saw in my other thread, I can't get the mail log working to obtain additional info.