wnasich / trapemail

Extend Network/Email/CakeEmail allowing override original recipients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trapemail

Extend Network/Email/CakeEmail allowing override original recipients.

See https://github.com/wnasich/TrapSmtp to use a better approach.

Install

Copy content of Lib folder into your app/Lib.

Usage

Whenever you need to send email, ensure this class is loaded:

App::uses('TrapEmail', 'Lib/Network/Email');

add to your config array a new element 'realRecipients':

$config['realRecipients'] = array('trap@domain.com');

use $config to create a new TrapEmail object:

$email = new TrapEmail($config);

after $email->send() you will get an email in trap@domain.com with original recipients in the header as below:

  • X-intended-to
  • X-intended-cc
  • X-intended-bcc

About

Extend Network/Email/CakeEmail allowing override original recipients

License:MIT License


Languages

Language:PHP 100.0%