Roundcube Community Forum
Third Party Contributions => API Based Plugins => Topic started by: Loguithat1955 on January 02, 2018, 08:58:11 AM
-
Is there a function to add a attachment to a empty e-mail, when i have the full path of this attachment on the server? I have seen that there is a function rcmail_save_attachment(), but i allways get a Internal Server Error 500, if i try to use this. i tryed it with:
$attachment = rcmail_save_attachment($fullfilepath, null);
-
You can add then in the message_compose hook https://github.com/roundcube/roundcubemail/wiki/Plugin-Hooks#message_compose
-
If I understand this correctly, this hook is executed when I click on the "create new mail" button. But I have already opened the new, mostly empty, mail. I have placed a new button in the attachment area. This brings me the path to a file stored on the server. This file should now to be attached to the already opened mail, identical to the function how I can attach new files via the normal upload.
-
I think, i have found a way to get what i need. But now i get the following error message "
PHP Fatal error: Uncaught Error: Call to undefined function rcmail_filetype2classname()
" when i use:
$rcmail->output->command('add2attachment_list', "rcmfile$id", array(
'html' => $content,
'name' => $attachment['name'],
'mimetype' => $attachment['mimetype'],
'classname' => rcmail_filetype2classname($attachment['mimetype'], $attachment['name']),
'complete' => true), $uploadid);
Do i have to include some file before?
Additionally i get the same error for rc_mime_content_type($filepath, basename($filepath))
-
You're using function aliases no longer available in Roundcube 1.3. See https://github.com/roundcube/roundcubemail/blob/release-1.2/program/include/bc.php for replacements.
-
Ahhhh thx for this link. Now it works and i have released a new version of the storage plug-in.