I'm using standard php mail() to send emails. My host says they're leaving the server but they're not being delivered to any mail box on the servers of another hosting company. Sadly 75% of the mail needs to go via that other hosting company. Their techs say the emails never hit their servers so it's not a spam filter at their end. Our techs say they do actually leave. If I send to gmail or any other email address they get delivered. How do I get around this problem, debug it etc.
the ONLY reliable method to solve this problem is having your own dedicated server and thus to have full access and control of all log files and mail config. mail leaving server - means OUT of mailq however if on recipient side your server config spam filter the mail is rejected before entering recipient mailq - then that mail may eventually never be listed on recipient because rejected before / without logged. for example postfix allows various header checks, DNS checks, resolvable sender etc before the mail enters regular spam block lists. to solve the issue you need to know all details of your mail server config - and the sequence in which all filters are applied. you also need to see to "conversation" of your mail server with recipient mail server, hence for a limited period of time a high debug value may be required to get more feedback. as long as you are on regular hosting, there is little help, because little control by you. make sure that ALL mail sent by your server ( php ) has proper senders data such as domain name and existing user name to assure that all mail leaving your server can by properly identified as valid sender domain / valid user @ your domain.
It sounds like your host is filtering out emails or the receivers just do not know how to check the spam log. If your host is filtering out the emails then you will have no luck on changing it without root access. If its being marked as spam on the other peoples end it could be because the IP is blacklisted or the receivers spam settings are to high.
Telnet from your application server to the other hosts server you will see the smtp communication whether that server accepts the email or not.
telnet is a good point in case this is new to you, a Google for telnet smtp server test will show you various howtos. have a look at the microsoft hwotos ! to be reliable however you need to do this testing ON YOUR SERVER and NOT form your home machine. communication from your mail server directly needs to be tested for OUT-going mails NOT the communication TO your mail server for INgoing as would be tested when you telnet on your home PC to your mail-server. that requires telnet to be installed on your server and available to you when logged in via SSH. most host have telnet installed. then run the telnet shell commands on your remote server to see the communication details. BTW if you are new to telnet quit is the telnet command to END a telnet session ... and return to regular shell mode