i was fixing a website’s contact form email not being sent today.
after debugging, the problem was:
1. php code was missing $header, it wasnt defined.
2. the email routing setting of the domain is set to ‘local mx’ when the email server is using google apps (gmail)
so when i fixed the two. it works again.
the point 2 above is for cpanel, and usually its safer to set as auto detect email routing, so there is less human error.
seems like there are a lot of other domains with the wrong email routing settings..
because in the exim_mainlog file, a lot of entries like R=localuser T=local_delivery
got to fix them..