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:
Then change the smtp_server:
$config[‘smtp_server’] = ‘localhost’;
$config[‘smtp_server’] = ‘127.0.0.1’;
$config[‘smtp_server’] = ‘xx.xx.xx.xx’; (replace xx your external server IP)
That should fix the issue with sending mail from roundcube.