Question

I am currently struggling, trying to integrate an Email Imap plugin, which I need for the application I am building, but somehow I cannot get cake to load the datasource inside the file.

My file structure is currently as follows

Plugin\emails\models\datasources\imap_source.php

My database Config :

public $emailTicket = array(
        'datasource' => 'emails.imap',
        'server' => 'imap.gmail.com',
        'connect' => 'imap/tls/novalidate-cert',
        'username' => 'myemail@domain.com',
        'password' => '**********',
        'port' => '143', //incoming port 
        'ssl' => true,
        'encoding' => 'UTF-8',
        'error_handler' => 'php',
        'auto_mark_as' => array(
        'Seen',
        // 'Answered',
        // 'Flagged',
        // 'Deleted',
        // 'Draft',
        ),
    );

What other values I tried for the datasource key :

  • 'Emails.ImapSource' (I read that datasource should be camelcase) but this gives Missing plugin error since the plugin folder name start with lower case.
  • 'emails.models.datasources.imap_source'
  • 'emails.imap_source'
  • 'emails.imapSource'
  • 'emails.ImapSource'

Also In case you were wandering, yes I am loading plugin from bootstrap tried CakePlugin::load('emails'); and CakePlugin::load('Emails');

I am sure this is some naming convention which im missing. Any ideas ? Thanks in advance

PLEASE HELP, I'M DESPERATE here

Was it helpful?

Solution

I dont think you downloaded the correct version of that plugin.

You should download this one:

https://github.com/nicolasramy/cakephp-emails-plugin/tree/cake-2.0

And with that, you can place it directly into your app/Model/Datasource/ImapSource.php. You don't need to create a plugin for it.

It should work if you do it this way, unless you are using CakePHP 1.3, which I dont think you are since you said you are building an application.

Thanks,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top