I have used a topic from hmailserver to solve my problem,
https://www.hmailserver.com/forum/viewtopic.php?t=18194. I have enabled SMTP authentication and specified the authentication in roundcube/config/defaults.inc.php
@line 238 TO @line 248
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$config['smtp_auth_type'] = 'LOGIN';
Thank you.