3

I have installed Roundcube webmail in my WAMPSERVER and I can access my emails via localhost/roundcube url, But I can not send email via my roundcube. I get the alert with the following error. SMTP Error (-1): Connection to server failed

I am sure there will be a solution. please help me

Nawroz Salehi
  • 79
  • 1
  • 11

4 Answers4

1

I got the answer I tried many ways but could not succeeded, Finally I opened my wamp/roundcubemail/config/defaults.inc.php and modified the following config value: $config['smtp_port'] = 465;

it is useful for any one who has installed roundcube into WampSever in windows and can not send email.

Nawroz Salehi
  • 79
  • 1
  • 11
1

Make sure of the following:

SMTP port

default is 25 use 587 for STARTTLS 465 for the deprecated SSL over SMTP

knows1
  • 11
  • 2
1

I had the same issue and tried everything I could find, only to figure I was editing the wrong configuration file : the changes in config/default.inc.php didn't help because I had to edit config/config.inc.php instead. It worked once I updated $config['smtp_port'] to the right port (depends on your mail server configuration) in the right file.

FWIW, here is a procedure which might help debugging (it surely did for me, showing that my changes weren't taken into account) : in program/lib/Roundcube/rcube_smtp.php, replace the following line (line 134 in Roundcube 1.4.7)

$this->response[] = "Connection failed: " . $result->getMessage();

by

$this->response[] = "Connection failed: " . implode(", ", $CONFIG);

(check about 70 lines above to find the definition of the fields), then restart the Apache server, try to send an email and check logs/errors.log.

For the sake of SEO, here is the generic error that was shown in logs/errors.log :

PHP Error: Invalid response code received from server (POST /roundcube/?_task=mail&_unlock=loading1613339144872&_framed=1&_lang=en_US&_action=send) SMTP Error: Connection failed: Invalid response code received from server (POST /roundcube/?_task=mail&_unlock=loading1613339144872&_framed=1&_lang=en_US&_action=send)

Furthermore, after this correction I couldn't connect back after logout, I had to configure $config['default_port'] = 143 for IMAP. For debugging one can use the same trick as above in file program/lib/Roundcube/rcube_imap.php, line 200 (beware that $config is lowcase in this file).

Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76
-1

just restart postfix, may work, i just do that.

> service postfix restart
Daniel
  • 97
  • 1
  • 5