SMTP data not accepted

More
11 months 1 week ago #144557 by davisharry
davisharry created the topic: SMTP data not accepted
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('This email address is being protected from spambots. You need JavaScript enabled to view it.', 'Mailer');
$mail->addAddress('This email address is being protected from spambots. You need JavaScript enabled to view it.', '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.

Please Log in to join the conversation.

More
11 months 6 days ago #144592 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
11 months 6 days ago #144603 by jelo
jelo replied the 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.

Please Log in to join the conversation.

More
11 months 6 days ago - 11 months 6 days ago #144606 by LouisGac
LouisGac replied the 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: 11 months 6 days ago by LouisGac.

Please Log in to join the conversation.

More
11 months 6 days ago - 11 months 6 days ago #144642 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 11 months 6 days ago by DenisChenu. Reason: see edit

Please Log in to join the conversation.

More
3 weeks 5 days ago #159049 by rpaul
rpaul replied the topic: SMTP data not accepted

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now