DownloadMail for each user account

Re: [Maurice] DownloadMail for each user account

By Jason - October 4, 2010

Hi Maurice,

What you can do, if each user account has it's email credentials, you can first select all the users from the database. Then for each user that has email credentials, you can call this function:

downloadMail_addAccount( $newAccountArray )

This adds an account to the array that the plugin then uses to download emails from. The array $newAccountArray needs to have this format:
'account' => 'example@gmail.com', // account name, displayed in CMS
'type' => 'IMAP', // account type: POP3 or IMAP

'username' => 'example@gmail.com', // or example@yourdomain.com for Google Apps
'password' => 'example',
'hostname' => 'imap.gmail.com',

'archive' => '[Gmail]/All Mail', // IMAP Only, move messages to this folder instead of deleting them
'secure' => true, // whether the host requires a secure connection: true or false (no quotes)
'port' => '', // (optional) port number (if non-standard)
'limit' => '5', // (optional) max messages to download at a time (set low to avoid server timeouts)
'testmode' => false, // (optional) don't archive or erase messages after downloading them


Hope this gets you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] DownloadMail for each user account

By Maurice - October 5, 2010

Wauw you got me exited i love the way we keep pushing cmsb and the plugins to the limit with out to much programming knowledge. [;)]
-------------------------------------------

Dropmonkey.nl