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
Solved

cakeemail on remote server

Posted on 2015-01-02
5
95 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
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.

839 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