Hi,
I want to append a text to all messages sent from RC, like yahoo or others webmails.
I tryed the following but without succes, can anyone help me... i think that my solution is good, but does not work, and i don't know why.
I modified the file roundcubemail/program/steps/mail/sendmail.inc, and just before the following comment: // create PEAR::Mail_mime instance
i add these lines.
$file = realpath("../../../config/msg_footer.txt"); if(file_exists($file)) { $handle = fopen($file, "r"); $content = fread($handle, filesize($file)); fclose($handle); $_POST['_message'] = $_POST['_message'] . "\n" . $content; }
of course, the file ../../../config/msg_footer.txt exists.
I need help.
Regards. Jose
Hi, Jose,
2005/11/11, JOSE A. HERRAN jherran@kedesfase.com:
I want to append a text to all messages sent from RC, like yahoo or others webmails.
What you are trying to add is only useful as a general message for the whole system. This could be useful for company's disclaimers, but it's not useful in the way other webmails do. I guess you want to add a signature, and that should be independent for every different user.
I modified the file roundcubemail/program/steps/mail/sendmail.inc, and just before the following comment: // create PEAR::Mail_mime instance
i add these lines.
$file = realpath("../../../config/msg_footer.txt"); if(file_exists($file)) { $handle = fopen($file, "r"); $content = fread($handle, filesize($file)); fclose($handle); $_POST['_message'] = $_POST['_message'] . "\n" . $content; }
If this feature is going to be used should be part of the main config file (writting the disclaimer there (as raw text) or with the path to the text file).
-- Andres Jimenez
JOSE A. HERRAN wrote:
Hi,
I want to append a text to all messages sent from RC, like yahoo or others webmails.
I tryed the following but without succes, can anyone help me... i think that my solution is good, but does not work, and i don't know why.
I modified the file roundcubemail/program/steps/mail/sendmail.inc, and just before the following comment: // create PEAR::Mail_mime instance
i add these lines.
$file = realpath("../../../config/msg_footer.txt"); if(file_exists($file)) { $handle = fopen($file, "r"); $content = fread($handle, filesize($file)); fclose($handle); $_POST['_message'] = $_POST['_message'] . "\n" . $content; }
of course, the file ../../../config/msg_footer.txt exists.
The path to the footer file is wrong. Please note that the index.php file (in RC root folder) is executed and only includes the step file. The path to the text file has t be relative to the root dir: config/msg_footer.txt
I need help.
Regards. Jose
Regards, Thomas
Hi "JOSE A.HERRAN" jherran@kedesfase.com,
$file = realpath("../../../config/msg_footer.txt"); if(file_exists($file)) { $handle = fopen($file, "r"); $content = fread($handle, filesize($file)); fclose($handle); $_POST['_message'] = $_POST['_message'] . "\n" . $content; }
of course, the file ../../../config/msg_footer.txt exists.
Can PHP find it?
Add a print("<h1>Found file!</h1>"); line inside the conditional and see if it can.
Can PHP read the file? Try ptinring the messge to the screen after modification.
Craig Webster | web: http://xeriom.net/ | Monkey see, monkey do: Okay. Xeriom.NET | tel: +44 (0)131 516 8595 | Monkey top post: Bad monkey.