Thursday, February 20, 2014

CakeEmail not sending (possibly a problem with local web server?)

Hello-

I am having a problem with CakeEmail.  Whenever I try to send an email, I can get one or two of them to work, but then the emails just seem to get "stuck".  Sometimes restarting my computer or restarting apache will cause the stuck emails to go through all at once, but that is not a consistent solution to the problem.

I've looked at the apache error logs and the mail logs and neither of them show any errors related to this.  I have no idea if this is related to Cake or to my local apache set-up or something else completely....

In my controller function:

$Email = new CakeEmail();
$Email->sender($this->request->data['Person']['email'], 'MyApp emailer');
$Email->from(array($this->request->data['Person']['email'] => 'Atlas'));
$Email->to('username@gmail.com');
$Email->subject('Email from '.$senderName);
$Email->config('gmail');

In Config/email.php:

public $gmail = array(
        'transport' => 'Smtp',
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'timeout' => 30000,
        'username' => 'username@gmail.com',
        'password' => 'password',
        'client' => null,
        'log' => true
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    );

Any suggestions for where to go from here?  I'm stumped... :/ 


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: