Solved

cakeemail on remote server

Posted on 2015-01-02
5
99 Views
Last Modified: 2015-01-26
Hi,

I am having problems with cakephp email.
I have this weird problem where my below email code works fine on my local server but not on the remote server.

The error I get is
SMTP Error: 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 u5sm29708221pdh.54 - gsmtp

which doesnt make any sense to me because my email does work from my local server, the google account has low security enabled already.

my email.php

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

in controller


 
 $Email = new CakeEmail();
                             $Email->config('gmail2');
                            // $to=$item['Tutor']['email'];
                             $to='xxxxxxx';
                             $Email->from( array('xxxxxx' => 'Aptutoring'));
                             $Email->to($to);
                             $Email->subject('Hello');
                             $Email->send($message);   //$message set elsewhere
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 40528958
That is a reply from the google's mail servers stating that the username or password is incorrect: https://support.google.com/mail/answer/78754

As it says in the article, it could also be the need for an App password: https://support.google.com/accounts/answer/185833

When you sign in from multiple locations and multiple times quickly as you may have been while testing on your production server, there's every chance that Google has blocked your server.
0
 

Author Comment

by:jagguy
ID: 40530753
I agree with your reply as I knew this already but how do I fix it?
An app password is for a phone and I am using PC's so why would this cause an issue and my password/login is correct.


Where to from here?
0
 

Accepted Solution

by:
jagguy earned 0 total points
ID: 40563468
The problem works now after I restrted the server
0
 
LVL 43

Expert Comment

by:Rob
ID: 40563481
Nothing like a restart to fix things *grin*
0
 

Author Closing Comment

by:jagguy
ID: 40570223
I solved it
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question