# Send a copy of an e-mail

I have a page blocked by a login module, and I have the "Forgot my password" link etc .. I want to send a copy of the send e-mail to an other email.

For example. User1 lost his password, he click on the "Forgot my password" link, so he receive an mail with a token .. But I want to receive it too, How can I do this ? Is there an option in the module ? Thank you :)

I've had a look and you may want to check out the following files;

root/lib/components/com_users/models/remind.php

and

root/lib/components/com_users/models/reset.php

You should be able to add your own email in as a CC there, with something like

$mailer->addCC("carboncopy@yourdomain.com") Although according to the official documentation if there are multiple recipients, you would put each recipient's email address in an array, as below; $recipient = array( 'person1@domain.com', 'person2@domain.com', 'person3@domain.com' );

$mailer->addRecipient($recipient);


The official documentation shows you how to send an email from a component.

I must say I haven't had the chance to try this although I can't imagine it's very difficult, perhaps somebody else can help you with the rest of the code?

Hopefully this points you in the right direction.

One option is to use something like CMandrill to send all messages through the Mandrill service (free for the first 12,000 messages). Doing it this way lets you view bounces, opens, copies of messages, etc. It won't email you a copy, but it will let you view EVERYTHING going out of the site.