Roundcube Community Forum

 

How to get To/Cc/Bcc fields in rcmail

Started by bocode, January 11, 2010, 05:57:02 AM

Previous topic - Next topic

bocode

Hi All,

I'm developing a new plugin and i need to get access to To, Cc and Bcc fields in the current composed message. My plugin gets called when "smtp_hook" is acted upon.

Is there a way to get these fields from rcmail instance?

Thanks in advance for the help,
Bo

rosali

You could use the 'outgoing_message_headers' hook. Look into my 'limit_recipients' plugin (part of MyRoundcube plugins bundle).
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

bocode

Thank you Rosali. I've actually used some of your code in my plugin, the code you've written is very easy to follow. Hats off to you :-).

Could you please tell me how to get the email id(s) in the To field. Am able to get the number of recipients from your code.

Thanks in advance

rosali

What do you mean by email id(s). Do you mean the recipients addresses?


$rcmail 
rcmail::get_instance();
$to $rcmail->imap->decode_address_list($args['headers']['To']);
print_r($to);
Regards,
Rosali
__________________
MyRoundcube Project (commercial)