Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8921097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:27:01+00:00 2026-06-15T06:27:01+00:00

I am implementing the email functionality and its also working fine . Now i

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:27:04+00:00Added an answer on June 15, 2026 at 6:27 am

    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

    public $test = array(
        'log' => true
    );
    

    Your Controller

    $Email = new CakeEmail('test');
    $email->template('adddoctor', 'add');
    $email->from('sender@example.com');
    $email->to('recipient@example.com');
    $email->subject('Account Detail');
    $email->send();
    

    If you then go into app/tmp/logs/debug.log you will see an entry for your email, which includes the headers and message

    2012-11-27 14:37:47 Debug: 
    From: My Site <me@example.com>
    X-Mailer: CakePHP Email
    Date: Tue, 27 Nov 2012 14:37:47 +0000
    Message-ID: <50ad02b4b1fba42733cc02456a@example.com>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    My 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been implementing some PHP/IMAP-based email handling functionality lately, and have most everything working
What all language components will have to be used for implementing an email service
I am now implementing an email filtering application using the Naive Bayes algorithm. My
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
Before implementing j_security_check using MySQL realm authentication in my web app. I had the
Given multi-tenant application, How are vendors implementing email notifications from an email account setup
I'm implementing OpenID authentication for a website and I want to get the email
I'm with some problems implementing my first application with Login with Facebook. The user
I am implementing basic email capabilities for administrators on my site. They can set
I'm implementing a logic where you can use either your username or email address

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.