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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:25:24+00:00 2026-06-05T01:25:24+00:00

Here are my code:- //Sending mail if ($this->Session->read(‘Enrollment.personalinfo_language’) == ‘English’) { $language = english;

  • 0

Here are my code:-

//Sending mail
if ($this->Session->read('Enrollment.personalinfo_language') == 'English') {
    $language = "english";
    $subject = "Thank you for submitting your enrollment request to Apna Energy.";
} else {
    $language = "spanish";
    $subject = "Gracias por enviar su solicitud de inscripci?n a Apna Energy.";
}
$details = $this->Session->read('Enrollment');
$details['plan_name'] = $product['Product']['name'];
$details['rate'] = $plan_rate;
$details['term'] = $product['Term']['term'];
$this->Email->sendAs = 'html';
$this->Email->from = 'Apna Energy <contact@apnaenergy.com>';
$this->Email->to = $this->Session->read('Enrollment.personalinfo_first_name') . ' ' . $this->Session->read('Enrollment.personalinfo_last_name') . '<' . $this->Session->read('Enrollment.personalinfo_email') . '>';
$this->Email->bcc = array('my@mail.com');
$this->Email->subject = $subject;
$this->set('details', $details);
if ($this->Session->read('Enrollment.personalinfo_language') == 'English') {
    $template = "enrollment_confirmation";
} else {
    $template = "enrollment_confirmation";
}
$this->Email->template = $template;
$this->Email->send();

My problem is if customer fill form they are receiving mail in his/her spam folder.. customer’s mail id in “to”.. and my mail id in “BCC” for me mail are coming fine in my inbox folder..

I followed two URL but they didn’t work out for me..

Cakephp emails going to spam

How do you make sure email you send programmatically is not automatically marked as spam?

Guide me in right direction..
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-05T01:25:27+00:00Added an answer on June 5, 2026 at 1:25 am

    by using SMTP

    with normal PHP your server must be configured properly which is not easy to do as a beginner (MX records need to match the servers ip etc).
    So just always stick to SMTP as mailing gateway and you will be fine.

    PS: I don’t think it has anything to do with your code in general, although it is not very beautiful. for instance: you should cast the array you read from the session to avoid notices thrown:

    $details = (array)$this->Session->read('Enrollment');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an email sending code mail($ToID,$subject,$urltoemail,$headers); after sending, the user is redirected header(Location:.$_SERVER['SCRIPT_NAME']);
how to do that?here is my current code, this is a windows form: mail.From
I am writing a standalone code for Sending mail from java. In this program
3 I am getting error in sending mail.here below i have mentioned my code.
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
Ok the error is showing up somewhere in this here code if($error==false) { $query
Possible Duplicate: PHPMailer AddAddress() Here is my code. require('class.phpmailer.php'); $mail = new PHPMailer(); $email
I am sending an e-mail via a PHP script. This works fine using NSMutableURLRequest
I'm using the code below for logging and sending error to my e-mail, but
Possible Duplicate: Send email using System.Net.Mail through gmail. (C#) I am using this code

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.