Welcome to the LimeSurvey Community Forum

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

ERROR 500 while sending E-Mail

More
10 years 7 months ago - 10 years 7 months ago #132914 by Liod_DS
Hi all,

Today I've upgraded our LS installation to [2.50+ Build 160309] everything went fine (except for my template, but i was aware of the incompatibility of the 2.06+ templates) ....

BUT when I try to send the email invitation(by token table) an error 500 occurs (exactly when i press "send" )...

Any suggestions ? i don't think i mess up something in the upgrade process :dry: all the other functions works pretty well...

EDIT:
in my last installation the mail were totally ok, and the configuration is the same

keep improving
Last edit: 10 years 7 months ago by Liod_DS. Reason: new info
The topic has been locked.
More
10 years 7 months ago #132930 by Drewskie
The topic has been locked.
More
10 years 7 months ago #132940 by Liod_DS
Ok Thanks!

I hope to find a quick fix before the patch release!

Deiv

keep improving
The topic has been locked.
More
10 years 7 months ago #132943 by Drewskie
Issue is resolved, will be in next update or can get it from link in bug report.
The topic has been locked.
More
10 years 7 months ago #133025 by steve_81
Thanks for the solution, works fine now.

Maybe you can help me with my own php I used in 2.05 where it works perfect, but in 2.50 160311 I get a 500 error.

On the endpage I have an input area for the EMail-address so the participant can enter his EMail to participate in a lottery. per $.post I refer to my php which sends an EMail to me (the administrator) and contains the inserted E-Mail.

My php-file looks like this:
Code:
<?php require("../application/third_party/phpmailer/class.phpmailer.php"); $maily = $_POST["mailaddress"]; checkEmail($maily); $nameit =$_POST["Surveyname"]; function checkEmail($adr) { $regEx = '^([^\s@,:"<>]+)@([^\s@,:"<>]+\.[^\s@,:"<>.\d]{2,}|(\d{1,3}\.){3}\d{1,3})$'; $proof = (preg_match("/$regEx/",$adr,$part)) ? $part : false; if ($proof == false) { echo ("Ungültige E-Mail-Adresse"); exit; } } $text = "<p>Es hat jemand das Formular ausgef&uuml;llt.<br>Die Daten lauten:</p>"; $text .= "<br>E-Mail: "; $text .= $maily; $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mailsurver.example.de"; // specify main and backup server $mail->SMTPAuth = false; // turn off SMTP authentication $mail->Username = ""; // SMTP username $mail->Password = ""; // SMTP password $mail->From = "server@example.de"; $mail->FromName = "me"; $mail->AddAddress("admin@example.de"); $betreff = "[Formular] ".$nameit; $mail->AddReplyTo("admin@example.de", "Information"); $mail->Sender="admin@example.de"; $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = $betreff; $mail->Body = $text; //$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; //$mail->SMTPDebug = 1; //for debugging if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Mail sent"; ?>

As I mentioned this code worked great with 2.05. But now no EMail is send and I get an 500 internal error. What changed? I suggest it is something with the file class.phpmailer.php or another?

Thanks
Stefan
The topic has been locked.
More
10 years 7 months ago #133029 by DenisChenu
We update phpMailer

github.com/LimeSurvey/LimeSurvey/commit/...5eda44f13238a73a77cb

Same can be apply to your php code.

But actually : seem better to use afterSUrveyComplete plugin event.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
10 years 7 months ago #133032 by steve_81
Perfect, that did the trick, thanks.
Until now I'm not familiar with plugins but maybe the time has come.
The topic has been locked.
Moderators: holch, tpartner

Lime-years ahead

Online-surveys for every purse and purpose