As there are many none working answers floating on the net here is a solution that will fix the issue for most of you:
Locate the configuration file of roundcube defaults.inc.php or main.inc.php:
/var/lib/roundcube/config/ (1.2)
or /etc/roundcube
Then change the smtp_server:
FROM
$config = ‘localhost’;
TO THIS
$config = ‘127.0.0.1’;
OR
$config = ‘xx.xx.xx.xx’; (replace xx your external server IP)
That should fix the issue with sending mail from roundcube.
This post is also available in: Norsk bokmål