I have a LAMP setup. I’m trying to intercept the mail() command and call my own Java code instead of calling sendmail etc. I’ve altered the php.ini
sendmail_path = /home/jlarkins/Desktop/CustomMail
which is my Java class file. Problem is, whenever I try to test this via a PHP test emailer, nothing happens. Can someone help me out, point me to the proper log file for Java errors or correct the syntax I’m using? I don’t care that it won’t send the email, I don’t want the email going out anyways. I just want to trap it and analyze via my own Java code.
First, check your PHP/Apache error log file to see if anything can be found there.
Is “CustomMail” a .class file? If yes, it is not an executable file, thus PHP cannot run it. You’ll have to point your sendmail_path variable on an executable file which will load your Java program and forward its arguments.
Something like this should work: