Cannot send mail with SMTP

More
1 year 3 months ago - 1 year 3 months ago #188361 by Kevin
I configured SMTP but I have not been able to send emails.

I got a syntax error in phpmailer 6.0.3 (version with LS 3.17) so I downloaded 6.0.7 and placed it in a different directory.

I changed the paths in load_phpmailer.php

I am using the same information that I use in MS Outlook such as:

smtp.example.com:587
tls
user at example.com


I requested a password from the LS login screen to determine if it works and I only got a message that shows, "Email failed" from line 289 of applications/controllers/admin/authentication.php

Debug mode is 2 in the config.php

I set $mail->SMTPDebug = 4 in PHPMailer.php


I added a path for the error_logs in php.ini and restarted apache but it did not produce a file.


Do you have any idea how I can get the email to work or see debugging information?
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

LimeSurvey Partners
More
1 year 3 months ago - 1 year 3 months ago #188362 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP
An update.

I created an example php page and got this error in the browser:
Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.example.com:587 (Permission denied)

I was able to send an email from the command line with these commands.

echo -n "\0user@example.com\0j83kc74,%8#ge" | base64
RETURNS: XDB1c2VyQGV4YW1wbGUuY29tXDBqODNrYzc0LCU4I2dl

openssl s_client -starttls smtp -crlf -connect smtp.example.com:587
EHLO there
AUTH PLAIN XDB1c2VyQGV4YW1wbGUuY29tXDBqODNrYzc0LCU4I2dl
MAIL FROM:user@example.com
RCPT TO:another_user@example.com
DATA
This is a Test. Hello World.
.
QUIT
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

More
1 year 3 months ago #188364 by jelo
Replied by jelo on topic Cannot send mail with SMTP

Kevin wrote: I configured SMTP but I have not been able to send emails.

Can you provide the settings you used inside LimeSurvey? Screenshot or textwise.
What version of LimeSurvey is used?

Kevin wrote: I got a syntax error in phpmailer 6.0.3 (version with LS 3.17) so I downloaded 6.0.7 and placed it in a different directory.

I cannot recommend changing the PHP source without first checking the config with an untouched installation.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

More
1 year 3 months ago #188367 by DenisChenu

Kevin wrote: I got a syntax error in phpmailer 6.0.3 (version with LS 3.17) so I downloaded 6.0.7 and placed it in a different directory.

Maybe this issue can be reported …

Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.example.com:587 (Permission denied)

The webserver user don't have the right to call external page.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: Kevin

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #188378 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP

DenisChenu wrote:

Kevin wrote: I got a syntax error in phpmailer 6.0.3 (version with LS 3.17) so I downloaded 6.0.7 and placed it in a different directory.

Maybe this issue can be reported …


I think you are correct.

Error in debug mode: https://github.com/PHPMailer/PHPMailer/issues/1572filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

More
1 year 3 months ago #188379 by Kevin
Attachments:

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #188381 by DenisChenu

Kevin wrote:

DenisChenu wrote:

Kevin wrote: I got a syntax error in phpmailer 6.0.3 (version with LS 3.17) so I downloaded 6.0.7 and placed it in a different directory.

Maybe this issue can be reported …


I think you are correct.

Error in debug mode: https://github.com/PHPMailer/PHPMailer/issues/1572filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated

Good, fixed in vendor :)

But i talk for LimeSurvey : www.limesurvey.org/community/bug-tracker

[Edit] : already on phpMailer 6.0.7 github.com/LimeSurvey/LimeSurvey/commit/...e82c9091681631dc830c

Ypou can update whole LimeSurvey not only phpMailer

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Last edit: 1 year 3 months ago by DenisChenu. Reason: Edit

Please Log in to join the conversation.

More
1 year 3 months ago #188382 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP
I am using imap.startlogic.com:587 with grafana and it works.

I changed the bounce settings in LS to the same as grafana but it did not make a difference... but I assume bounce is not for sending email.

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #188383 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP

DenisChenu wrote: You can update whole LimeSurvey not only phpMailer


Ok thanks.
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

More
1 year 3 months ago #188384 by DenisChenu
Last version of LimeSurvey is up to date with phpMailer : github.com/LimeSurvey/LimeSurvey/commit/...e82c9091681631dc830c

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: Kevin

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #188385 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP
Thanks. I think I am using 3.17.3.
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #188400 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP
I uncommented if(!$sent) var_dump($maildebug); in application/helpers/common_helper.php

I got this message! This will be a huge help!
2019-09-02 19:53:13 SMTP INBOUND: &quot;535 Incorrect authentication data&quot;<br>
2019-09-02 19:53:13 SERVER -&gt; CLIENT: 535 Incorrect authentication data<br>
2019-09-02 19:53:13 SMTP ERROR: Password command failed: 535 Incorrect authentication data<br>
SMTP Error: Could not authenticate.<br>
2019-09-02 19:53:13 CLIENT -&gt; SERVER: QUIT<br>


UPDATE: I added example.com for a screenshot and forgot to put the real domain back in the box.

I think the problem might be with Selinux.

More comments here: stackoverflow.com/questions/57751445/per...iler-smtp-limesurvey
Last edit: 1 year 3 months ago by Kevin.

Please Log in to join the conversation.

More
1 year 3 months ago #188407 by Kevin
Replied by Kevin on topic Cannot send mail with SMTP
I think this Selinux command fixed it after updating PHPmailer.
setsebool -P httpd_can_network_connect 1

Please Log in to join the conversation.

More
1 year 3 months ago #188410 by DenisChenu

Kevin wrote: I uncommented if(!$sent) var_dump($maildebug); in application/helpers/common_helper.php

I got this message! This will be a huge help!

Argl … you can have this message with mail SMTP debug mode

I think this Selinux command fixed it after updating PHPmailer.

Great ! :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
3 months 4 weeks ago #203667 by dghrit
Replied by dghrit on topic Cannot send mail with SMTP
Old thread i knw,

But this may help someone facing similar issue on version 3.0+

Set debug as 1 in config.php

now open limesurvey\applications\helpers\common_helper.php


uncomment the below line to see the error received when sending SMTP email.

if(!$sent) var_dump($maildebug);

In the case where the mail admin provide the relaying service for a particular email ID, which does not require password to be entered in order to send the email.

This is where the problem happens.

As Limesurvey will expect that once a email username is added by the admin a password will be supplied too.

In order to take care of above.

comment the following line in the same file
$mail->SMTPAuth = true;

commenting this line will bypass the password verification.

Hope this helps other facing similar challenges.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now