Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

SMTP data not accepted

  • davisharry
  • davisharry's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144557 by davisharry
SMTP data not accepted was created by davisharry
Hi, I have recently use this system. Everything goes fine on localhost, but I can not send email on server(windows server 2012). And the company use exchange as Email server.
The error message is data not accepted,DATA end command failed Detail: Client does not have permissions to send as this sender SMTP code: 550 Additional SMTP info:5.7.1.... CLENT:550 5.7.1 Client does not have permissions to send as this sender.

I have google but nothing help.
then i wrote a test.php whit the basic code. Then it works.here is the code:

require '/application/third_party/phpmailer/class.phpmailer.php';
require '/application/third_party/phpmailer/class.smtp.php';
$mail = new PHPMailer;
$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'webmail.company.com.cn'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'szsur01'; // SMTP username
$mail->Password = '*****'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25; // TCP port to connect to

$mail->setFrom('szsur01@company.com.cn', 'Mailer');
$mail->addAddress('xx@qq.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';
}


It works. But in the limesurvey(2.55) i have no idea.
Next week we are going to do the survey, hope anyone can help me.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144592 by DenisChenu
Replied by DenisChenu on topic SMTP data not accepted
SMTP configuration issue : serverfault.com/questions/527404/users-u...ade-to-exchange-2013

Contact microsoft

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 topic has been locked.
More
7 years 4 months ago #144603 by jelo
Replied by jelo on topic SMTP data not accepted

DenisChenu wrote: SMTP configuration issue : serverfault.com/questions/527404/users-u...ade-to-exchange-2013

If that would be case, why is the test phpcode working without changing anything in Exchange.
I assume that in both cases the same credentials where used.

This issue looks more like a default value issue hidden in Limesurvey/phpmailer combo. The phpmailer library changed something (remember the TLS issue, where phpmailer used TLS even when it was disabled in Limesurvey settings.
The phpmailer settings are not complete exposed via a configfile. So some settings are hardcoded which might explain why the simple testphp works fine but the LS mailroutines have problems.

Check if there is no mistype in the fields in Limesurvey. And ensure you use the same credentials from you testcode in LS to crosscheck.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
7 years 4 months ago - 7 years 4 months ago #144606 by LouisGac
Replied by LouisGac on topic SMTP data not accepted
Rather than spending money for an outdated Microsoft server implying a lot of configuration, setting, and microsoft specific bugs, I'd rather suggest you to subscribe to one of the LimeSurvey Hosting solution:
www.limesurvey.org/2015-09-02-06-51-08/hosting

They work out of the box, include the mailing system.

Concerning the problem itself, it's hard to answer knowing that a lot of people are using Microsoft servers with LimeSurvey without any problem. If it was a bug in LimeSurvey, we'd probably have many complaints about it. It's not the case. So, IMHO, it's probably a configuration problem in global settings. Have a deep look in global settings.

Also, a solution more and more promoted by microsoft itself, is to use a Linux Virtual Machine on your Microsoft Server:
techcrunch.com/2016/11/16/microsoft-joins-the-linux-foundation/
msdn.microsoft.com/en-us/commandline/wsl/install_guide
Last edit: 7 years 4 months ago by LouisGac.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago - 7 years 4 months ago #144642 by DenisChenu
Replied by DenisChenu on topic SMTP data not accepted
Ha,

Remind something about office360 : Return-Path === From and must be allowed to send email via office360.

I think i start a plugin for this but where i put it ????????

Linked mantis : bugs.limesurvey.org/view.php?id=10533
[edit] better one : bugs.limesurvey.org/view.php?id=10529

It's not a LS bug : it's an office360 bug : Return-Path CAN be different then From.

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: 7 years 4 months ago by DenisChenu. Reason: see edit
The topic has been locked.
More
6 years 5 months ago #159049 by Ilegli_62473
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose