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 8677031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:20:58+00:00 2026-06-12T20:20:58+00:00

I am Using cakephp for one of my project. for sending email I am

  • 0

I am Using cakephp for one of my project. for sending email I am using cakeEmail. For that I created one gmail account for sending emails(i.e. used in code for send mail from that account).Mail sending works but sent mail appears recipient’s spam folder.
Also in gmail account that mail dosen’t appear sent mail folder.

code is as bellow :

In /app/Config/email.php file is :

class EmailConfig {

    public $gmail = array(
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'username' => 'username@gmail.com',
        'password' => 'password',
        'transport' => 'Smtp'
    );  

}

and code in my controller file for password recovery is :

public function _sendemail($user_data,$temporary_password){

            $email = new CakeEmail();
            $email->config('gmail');
            $email->template('welcome', 'password_recovery_email'); //template
            $email->emailFormat('html');
            $email->viewVars(array(
                               'temporary_password'=>$temporary_password,
                               'user_data'=>$user_data
                            ));
            $email->from(array('username@gmail.com' => 'Password Recovery'));
            $email->to($user_data['User']['email_address']);

            $email->subject('password recovery email');

            $result=$email->send();



    }

Please tell me what should I do to get all sent emails to appears in inbox rather than spam folder.

Thanks

  • 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-12T20:21:00+00:00Added an answer on June 12, 2026 at 8:21 pm

    A lot of reasons can make your email be considered a SPAM.

    • Maybe Gmail can’t check the sender (smtp source/your developing machine) as a trusted sender. Have you tried uploading your php script to another server (production) then sending it from there?

    • Have you tried changing the message content/subject to something different from “Recover your password”?

    • Have you tried sending the same message to another recipient?

    Gmail uses a lot of rules to check whether an email is a spam or not, check out this link: https://webapps.stackexchange.com/questions/5773/how-gmail-and-other-mail-services-detects-a-mail-as-a-spam

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

Sidebar

Related Questions

I'm using CakePHP to send an email. My controller code looks like: if ($this->User->save($this->request->data))
I am using CakePHP 1.3 on my LAMP Environment for one of my project,
I'm using CakePHP 2.2.0 and I need to create one route that get this
We're using cakephp 1.2 version for one of our newly developing project, so would
I am using cakephp 2.2 THis is my smtp setup in Config/email.php public $gmail
i am trying to create a Radio button using Cakephp like the one the
I'm developing a web app using a cakephp. I've one function in which I
Im using cakephp 2.0 and i have data submitted that i want to cleanup,
I am using CakePHP. I created an external class which is not a model
I'm using CakePHP in one website and I was wondering how can I automagically

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.