Take the 2-minute tour ×

I'm trying to use CakeEmail in a web application, but I keep running into a timeout error. All my Googling and Stacking only give me the idea that something is not configured correctly, but I can't seem to find what config option I'm missing or filling incorrectly. I'm trying to send using my Gmail account.

Gmail Config:

public $gmail = array(
                'host' => 'ssl://',
                'port' => 465,
                'timeout' => 30,
                'username' => 'my_gmail_account_name',
                'password' => 'my_gmail_account_password',
                'transport' => 'Smtp'

in app/Config/email.php

Email code:

$Email = new CakeEmail('gmail');
    $Email->from(array('my_gmail_account_name' => 'Dev'));
    $Email->subject('Export Email Test');
 $Email->send('This is a test email for ExportJobs.');

(As an additional note, the code that runs here is as part of a Cake Console program, so these methods are called when I run Console/cake file_name from the command line; also, that IP is the Gmail SMTP IP. When I try using the name, I get some DNS issue).

Does anyone happen to see what I'm missing?

Thanks for your time!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I found the problem I was having; it's a pretty silly error. I completely forgot that to use the gmail domain for SMTP, I have to preface the domain name as "smtp.gmail.com". Once I did that it used SMTP and worked just fine.

share|improve this answer
add comment

Your Answer


