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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:03:12+00:00 2026-05-24T04:03:12+00:00

A strange one to be honest. I have got this working completely fine on

  • 0

A strange one to be honest. I have got this working completely fine on my local machine but on the production server (CENTOS), the redirect after registering is hitting the email template..

Is there something I am missing here?

  function register() {
        $this->layout = 'login';
        $this->set('title_for_layout', 'Register');
        if(!empty($this->data)) {
                  $this->User->create();
                     if($this->User->save($this->data)) {
                        $this->data['User']['group_id'] = 4;
                        $this->_sendNewUserMail( $this->User->id );
                        $this->redirect(array('action' => 'approval'));
                    } else {
                $this->Session->setFlash(__('There were errors found in your registration.  Please check the highlighted fields', true));
                }
        }               
    }

    function _sendNewUserMail($id) {
        $this->Email->smtpOptions = array(
                            'port'=>'25', 
                            'timeout'=>'30',
                            'host' => 'localhost',
                            'username'=>'username',
                            'password'=>'password',
        );
        $this->Email->delivery = 'smtp';
        $User = $this->User->read(null,$id);
        $this->Email->to = array('someone@blah.com');
        $this->Email->subject = 'A new registration has been submitted';
        $this->Email->from = 'Me@blah.com';
        $this->Email->template = 'default';
        $this->Email->sendAs = 'html';
        $this->set('User', $User);
        $this->Email->send();
    }

I am completely stumped with this..

Many thanks for your help in advance!

  • 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-05-24T04:03:13+00:00Added an answer on May 24, 2026 at 4:03 am

    I would guess php_openssl is not enabled. Also, you should move the smtpOptions and delivery setting into _sendNewUserMail

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

Sidebar

Related Questions

This is a strange one, I have everything working but in the controller code
This is a strange one. A web application which runs fine on Windows Server
Strange one this, which isn't programming related directly, but I thought it important to
This is a strange one that I cannot see to figure out. I have
This is a bit of a strange one but I've just seen something on
I know this is bit of a strange one but if anyone had any
This is kind of a strange one. I have a CSV that I'm uploading
This one i had today is a strange one. I have this query in
this is a strange one, we have a printer setup with an IP and
This is a strange one as up until very recently this functionality was working

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.