Hello,
I work on a small plugin which modifiy a written email. However, I cannot modify header information. This is what I tried:
<?php
class smime extends rcube_plugin
{
function init()
{
$this->add_hook('message_before_send', array($this, 'change_header'));
}
function change_header($args) {
$rcmail = rcmail::get_instance();
$headers = $args['message']->headers();
$headers['Content-Type'] = "text/html; charset=US-ASCII;"
$args['message']->headers($headers);
return $args;
}
}
This code snippet should change Content-Type of a message to "text/html". However, when writing emails they are still from type "text/plain".
I'd really appreciate if someone could help me with that.
Regards
You want the message_outgoing_headers hook: http://trac.roundcube.net/wiki/Plugin_Hooks#message_outgoing_headers
This is exactly what I wanted, works!
<?php
class smime extends rcube_plugin
{
function init()
{
$this->add_hook('message_outgoing_headers', array($this, 'change_header'));
}
function change_header($args) {
$rcmail = rcmail::get_instance();
$args['headers']['Content-Type'] = "text/html; charset=US-ASCII;"
return $args;
}
}