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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:32:31+00:00 2026-06-14T19:32:31+00:00

pulling my hair out with this one. When I developed this cakephp (2.2) app

  • 0

pulling my hair out with this one.

When I developed this cakephp (2.2) app on my local machine, I could email via gmail using smtp without a problem. Since then I’ve deployed it onto a 1and1 server and I can no longer send. What even more frustrating is that I cant seem to get any decent debugging info from cake.

Heres the code:

if($fu['name']) {              

            $url = Router::url('/admin/', true );
            $ms = $url;
            $ms = wordwrap($ms,1000);

           //============Email================//
           // SMTP Options
           $this->Email->smtpOptions = array(
               'port'=>'465',
               'timeout'=>'30',
               'host' => 'ssl://smtp.gmail.com',
               'username'=>'myemail@gmail.com',
               'password'=>'password'
                 );
           $this->Email->template = 'newExpenseClaim';
           $this->Email->from    = 'Expense Tracker <myemail@email.co.uk>';
           $this->Email->to      = 'myemail@fakeemail.com'; 
           $this->Email->subject = 'New Expense Claim Submitted - Please Review';
           $this->Email->sendAs = 'both';

           $this->Email->delivery = 'smtp';

           // Set username & url in email
           $this->set('user', $fu['name']);
           $this->set('ms', $ms);
           //$this->Email->send();

           if(!$this->Email->send()) {
                CakeLog::write('debug', $this->Email->smtpError);
            }

           $this->set('smtp_errors', $this->Email->smtpError);

           //============EndEmail=============//   
        }

I get the following debug info each times it fails (printed on screen, nothing goes into the debug log which is massively anoying).

    Connection refused

Error: An Internal Error Has Occurred.
Stack Trace

    CORE/Cake/Network/Email/SmtpTransport.php line 95 → CakeSocket->connect()
    CORE/Cake/Network/Email/SmtpTransport.php line 60 → SmtpTransport->_connect()
    CORE/Cake/Network/Email/CakeEmail.php line 1059 → SmtpTransport->send(CakeEmail)
    CORE/Cake/Controller/Component/EmailComponent.php line 345 → CakeEmail->send(null)
    APP/Controller/ExpenseClaimsController.php line 236 → EmailComponent->send()
    APP/Controller/ExpenseClaimsController.php line 278 → ExpenseClaimsController->notifyAdminsOfNewClaims()
    [internal function] → ExpenseClaimsController->add()
    CORE/Cake/Controller/Controller.php line 485 → ReflectionMethod->invokeArgs(ExpenseClaimsController, array)
    CORE/Cake/Routing/Dispatcher.php line 186 → Controller->invokeAction(CakeRequest)
    CORE/Cake/Routing/Dispatcher.php line 161 → Dispatcher->_invoke(ExpenseClaimsController, CakeRequest, CakeResponse)
    APP/webroot/index.php line 92 → Dispatcher->dispatch(CakeRequest, CakeResponse)

Can anyone help? Thanks in advance

** Updated with wrapper and soctet info **

These are the wrappers and sockets I get returned from those functions:

Wrappers:

array(
    (int) 0 => 'https',
    (int) 1 => 'ftps',
    (int) 2 => 'compress.zlib',
    (int) 3 => 'compress.bzip2',
    (int) 4 => 'php',
    (int) 5 => 'file',
    (int) 6 => 'data',
    (int) 7 => 'http',
    (int) 8 => 'ftp',
    (int) 9 => 'zip'
)

Sockets

array(
    (int) 0 => 'tcp',
    (int) 1 => 'udp',
    (int) 2 => 'unix',
    (int) 3 => 'udg',
    (int) 4 => 'ssl',
    (int) 5 => 'sslv3',
    (int) 6 => 'sslv2',
    (int) 7 => 'tls'
)
  • 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-14T19:32:32+00:00Added an answer on June 14, 2026 at 7:32 pm

    In first you should check what your hosting support outgoing connection. Simple check is similar

    echo implode("", file("http://google.com"));

    In second you should check what PHP support SSL connection and it have stream wrapper for SSL.
    I now not remember how you can check it. But search in google by keywords: PHP stream wrapper SSL

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

Sidebar

Related Questions

I am pulling my hair out on this one... I am using the ASIHTTPRequest
I'm pulling my hair out over this one. I have an app that when
I'm pulling my hair out on this one. I'm using the FlexSlider on a
I'm pulling my hair out with this one... My app is running on jquery-mobile
Pulling my hair out over this one. I have one wordpress install at /2009
I'm pulling my hair out on this. I do some manual deserialization using XmlReader
I'm pulling my hair out on this one. I am trying to implement a
Hey all, I'm pulling my hair out on this one. I've checked all my
This one has me pulling my hair out. I'm trying to implement a very
Absolutely pulling my hair out on this one. There seems to be no black

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.