Author Topic: Roundcube API  (Read 10938 times)

Offline elasticguy

  • Newbie
  • *
  • Posts: 3
Roundcube API
« on: April 05, 2014, 04:59:02 AM »
Hello everyone! :)

I am making my own CMS and I was wondering if I can get the current unread amount of emails and from who the email was ( so from what email adress) and the subject of the email.

Is this possible with the API or is it also possible without the API? I didn't find much about the API though.

- ElasticGuy

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Roundcube API
« Reply #1 on: April 05, 2014, 08:25:35 AM »
I think your thinking of the plugin api which doesn't allow you to get data from a third party source it only to code plugins for Roundcube. You need to make a script that checks the imap server for the unread count (the same thing the Roundcube does), maybe check out the Roundcube framework and see about integrating that into your CMS.

Offline elasticguy

  • Newbie
  • *
  • Posts: 3
Re: Roundcube API
« Reply #2 on: April 05, 2014, 01:58:03 PM »
Oh ok, I've looked for the code in the roundcube source but couldn't really find it so I made tits this xD Gonna test it in a sec but thanks for your help :)

Code: [Select]
<?php
$imap imap_open("{imap.myserver.org}INBOX""username""password")
or die("can't connect to IMAP");

$check imap_mailboxmsginfo($imap);

if ($check
{
echo "Unread: "   $check->Unread  "<br />\n" ;
}
else 
{
echo "imap_check() failed:";
}
imap_close($imap);
?>


Edit Hmm weird I can't get that code working. It's not echoing anything. Do you see the mistake?
« Last Edit: April 05, 2014, 03:14:05 PM by elasticguy »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Roundcube API
« Reply #3 on: April 05, 2014, 05:59:14 PM »
Check for errors. If I had to guess its because your trying to use the PHP imap extension which isn't included in most PHP installations.

Offline elasticguy

  • Newbie
  • *
  • Posts: 3
Re: Roundcube API
« Reply #4 on: April 06, 2014, 01:10:15 PM »
I didn't get any errors and @ the php.net page they don't say you have to include anything

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Roundcube API
« Reply #5 on: April 06, 2014, 08:50:51 PM »
You don't need to include anything but it does need to be complied as part of PHP: http://www.php.net/manual/en/imap.installation.php I can't really offer any other help since Roundcube doesn't use the standard PHP imap extension I don't know much about it.