I am implementing the email functionality and its also working fine . Now i have to debug in local so had done some changes as shown below
in app/config/email.php i have created this
public $test = array(
'from' => 'you@localhost',
'transport' => 'Debug',
);
Now in my controller i have write the below code
$Email = new CakeEmail('test');
$email->template('adddoctor', 'add');
//$email->emailFormat('html');
$email->from('sender@example.com');
$email->to('recipient@example.com');//$data['User']['email_id'];
$email->subject('Account Detail');
$email->send();
after sending mail it redirects to the index page . so in index.ctp file i have write
<?php echo $this->Session->flash('email'); ?>
i dont want to send actual mail but i just only want to show it.
so can any one tell me which changes still i have to do for email debug ?
here some has given the answer
CakeEmail debug
but dont understand where to write that code ?
This is what you need to do to have your emails saved to the log, which is related to the solution for the other question you are trying to implement:
app/Config/email.php
Your Controller
If you then go into app/tmp/logs/debug.log you will see an entry for your email, which includes the headers and message
However, in my opinion this is all fairly useless unless you want to see the headers. For a start, you can’t actually ‘see’ what your email will look like, and secondly, the email will continue to send to the recipient.
If you want to see what the actual layout/CSS of your email looks like you are probably better off just sending yourself some test emails.
I don’t know why Cake got rid of the old email debugging functionality, as it was more helpful.