Solved

cakeemail on remote server

Posted on 2015-01-02
5
91 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 42

Expert Comment

by:Rob Jurd, EE MVE
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 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40563481
Nothing like a restart to fix things *grin*
0
 

Author Closing Comment

by:jagguy
ID: 40570223
I solved it
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

929 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now