Solved

cakeemail on remote server

Posted on 2015-01-02
5
90 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
Comment Utility
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
Comment Utility
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
Comment Utility
The problem works now after I restrted the server
0
 
LVL 42

Expert Comment

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

Author Closing Comment

by:jagguy
Comment Utility
I solved it
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

744 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

8 Experts available now in Live!

Get 1:1 Help Now