A thought: Anybody tried to fetch data from email?

Hello everybody, nice forum style, seems i didn’t login for so long now :slight_smile: I miss you all, albert, jsb, SEMPAI cafekadm and the rest of the gang :slight_smile:

Like in some open scripts, can we use sc to monitor and get data from an email inbox and view/insert in a database? say we have access to IMAP and pop3

e.g. in kayako and other systems, people do send emails to central mailbox, those mails.are inserted as records in db and appear in the pages accordingly.

Anybody tried to do this using scriptcase? I want to process some data that is received by emails… any other idea serves this purpose will be also appreciated


Yes, you can create a blank application to access your imap/pop email box the standard php way (loads of samples to google for). Needs to be a stand-alone app to be called from a schedular who runs your application.

Hey mike if u get that working do us a favour please and Post the mail get here, have tried this some time ago and failed miserably… Be good to have a script case working example as some of the ones available in Google just gave me a headache lol



That should giive you enough to play with.

$mb = imap_open("{imap.gmail.com:993/imap}","xyz@gmail.com", “password” );

$messageCount = imap_num_msg($mb);
for( $MID = 1; $MID <= $messageCount; $MID++ )
$EmailHeaders = imap_headerinfo( $mb, $MID );
$Body = imap_fetchbody( $mb, $MID, 1 );
doSomething( $EmailHeaders, $Body );

i tried above code but getting error

Fatal error: Uncaught Error: Call to undefined function imap_open()

Please advise do i need to make changes in in php file???