- Posts: 55
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
<?php 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 = 'smtp-relay.sendinblue.com'; // 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('info@vecteursleviers.com', 'Mailer'); $mail->addAddress('jltrussart@gmail.com', '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'; } ?>
2017-08-13 11:38:20 Connection: opening to smtp-relay.sendinblue.com:587, 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 smtp-relay.sendinblue.com:587 (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. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
The error message from phpmailer is triggered for many issues. The statement of your provider can be true.jltrussart11 wrote: It's seems that servers do not allow SMTP.
/** * Whether to enable TLS encryption automatically if a server supports it, * even if `SMTPSecure` is not set to 'tls'. * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. * @var boolean */ public $SMTPAutoTLS = false;
That is not what I meant.jltrussart11 wrote: Using a third party tools is what I exactly want to do.