SMTP Error

2 months 3 weeks ago #157251 by jltrussart11
jltrussart11 created the topic: SMTP Error

I' using the latest version of LimeSurvey and i'm trying to configure the SMTP to use with Sendinblue.

I've tested theses credentials in a php script on my server and I'm able to send and receive mail. My server seems to be well configured.

When I send an invitation, I got this message:

2017-07-30 14:35:08 SMTP ERROR: Failed to connect to server: Connection refused (111)
2017-07-30 14:35:08 Échec de la connexion SMTP.

Any idea what's the problem? Is there a way to have more information than SMTP error 111?

Thanks a lot!

Please Log in to join the conversation.

2 months 1 week ago - 2 months 1 week ago #157543 by jltrussart11
jltrussart11 replied the topic: SMTP Error
Hello folks,

I've managed to get details to the error.

I've tried with this PHP code to connect via PHPMailer.
require 'application/third_party/phpmailer/class.phpmailer.php';
require 'application/third_party/phpmailer/class.smtp.php';
$mail = new PHPMailer;
$mail->SMTPDebug = 4; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ''; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '***'; // SMTP username
$mail->Password = '***'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom('', 'Mailer');
$mail->addAddress('', 'Joe User'); // Add a recipient
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';

and I get this error.
2017-08-13 11:38:20	Connection: opening to, timeout=300, options=array ( ) 2017-08-13 11:38:22	Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to (Connection refused) 2017-08-13 11:38:22	SMTP ERROR: Failed to connect to server: Connection refused (111) 2017-08-13 11:38:22	SMTP connect() failed. Message could not be sent.Mailer Error: SMTP connect() failed.

Port 587 is open on my server. I also test my SMTP details in a free LimeSurvey Pro and it's working.

Any idea what could I test on my server to make SMTP works? Do I need to change my Hosting server to something like BlueHost?
Last Edit: 2 months 1 week ago by jltrussart11.

Please Log in to join the conversation.

1 month 4 weeks ago #157846 by DenisChenu
DenisChenu replied the topic: SMTP Error
A lot pof hoster have whitelist for smtp connexion. You must see for start with your hoster i think.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now