PHP Fatal error: Call to undefined function imap_open()

I got the following error while running a script:

PHP Fatal error: Call to undefined function imap_open()

Solution:

apt-get install php5-imap