juan
juan

Reputation: 291

email component smtp error cakephp

im getting this error when sending emails with cake's email component

[smtpError] => 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 r11sm77490vbx.11

any ideas? here's my code...

 $this->Email->to = array(' juan <[email protected]>'); 
 $this->Email->from = '[email protected]';
    $this->Email->subject = 'Welcome to our really cool thing';
    $this->Email->template = 'simple_message'; 

    $this->Email->sendAs = 'both'; 
  $this->Email->smtpOptions = array(
        'port'=>'465', 
        'timeout'=>'30',
  'auth' => true,
        'host' => 'ssl://smtp.gmail.com',
        'username'=>'[email protected]',
        'password'=>'********',

   );

Upvotes: 1

Views: 1429

Answers (3)

Gabriel Spiteri
Gabriel Spiteri

Reputation: 4978

Apart from that stated by @Travis ... i would also suggest that the from should also be constructed in this format "Name " ... otherwise I don't think the email will go through.

Upvotes: 1

Travis Leleu
Travis Leleu

Reputation: 4240

Well, the link in the error message to google's support forums say that the username and password combination are incorrect. I'd recommend that you try logging in to that gmail account with the specified password, just to triple check that you're not mistaken. That happens a lot to me, all the time.

Secondly, are you sure you're supposed to put the @gmail.com in for the username? Maybe it should just be 'name' rather than '[email protected]'.

Upvotes: 1

Nigel
Nigel

Reputation: 1715

You have a space there before your name, which could possibly be sending the wrong data. Have you tried the code without that extra space?

Upvotes: 1

Related Questions