mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Respect the limesurvey email settings
This commit is contained in:
42
email.php
42
email.php
@@ -141,6 +141,48 @@ if (isset($_POST['firstname']))
|
||||
|
||||
$mail = new PHPMailer;
|
||||
|
||||
$sql = "SELECT stg_value
|
||||
FROM " . LIME_PREFIX . "settings_global
|
||||
WHERE stg_name = 'emailmethod'";
|
||||
|
||||
$emailmethod = $db->GetOne($sql);
|
||||
|
||||
switch ($emailmethod) {
|
||||
case "qmail":
|
||||
$mail->IsQmail();
|
||||
break;
|
||||
case "smtp":
|
||||
$mail->IsSMTP();
|
||||
|
||||
$sql = "SELECT stg_name,stg_value
|
||||
FROM " . LIME_PREFIX . "settings_global";
|
||||
$ec =$db->GetAssoc($sql);
|
||||
|
||||
if (strpos($ec['emailsmtphost'],':')>0)
|
||||
{
|
||||
$mail->Host = substr($ec['emailsmtphost'],0,strpos($ec['emailsmtphost'],':'));
|
||||
$mail->Port = substr($ec['emailsmtphost'],strpos($ec['emailsmtphost'],':')+1);
|
||||
}
|
||||
else {
|
||||
$mail->Host = $ec['emailsmtphost'];
|
||||
}
|
||||
$mail->Username =$ec['emailsmtpuser'];
|
||||
$mail->Password =$ec['emailsmtppassword'];
|
||||
if (trim($ec['emailsmtpuser'])!="")
|
||||
{
|
||||
$mail->SMTPAuth = true;
|
||||
}
|
||||
break;
|
||||
case "sendmail":
|
||||
$mail->IsSendmail();
|
||||
break;
|
||||
default:
|
||||
//Set to the default value to rule out incorrect settings.
|
||||
$emailmethod="mail";
|
||||
$mail->IsMail();
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT stg_value
|
||||
FROM " . LIME_PREFIX . "settings_global
|
||||
WHERE stg_name LIKE 'siteadminemail'";
|
||||
|
||||
Reference in New Issue
Block a user