Skip to content

Commit

Permalink
Added patch for proper character MIME encoding for emails depending o…
Browse files Browse the repository at this point in the history
…n survey language

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1282 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Mar 7, 2005
1 parent c1277f4 commit bc5c4cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions admin/tokens.php
Expand Up @@ -652,6 +652,8 @@
$emcount = mysql_num_rows($emresult);
$headers = "From: {$_POST['from']}\r\n";
$headers .= "X-Mailer: $sitename Emailer (PHPSurveyor.sourceforge.net)\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=" .encode_lang($defaultlang) . "\r\n";
$message = strip_tags($_POST['message']);
$message = str_replace(""", '"', $message);
if (get_magic_quotes_gpc() != "0")
Expand Down Expand Up @@ -696,6 +698,7 @@
// line endings. This converts them to just <LF> line endings. This is not correct, and may
// cause problems with certain email server
//$sendmessage = str_replace("\r", "", $sendmessage);
$msgsubject= encode_lang($defaultlang,$msgsubject);
if (mail($to, $msgsubject, $sendmessage, $headers))
{
$udequery = "UPDATE {$dbprefix}tokens_{$_POST['sid']} SET sent='Y' WHERE tid={$emrow['tid']}";
Expand Down Expand Up @@ -828,6 +831,8 @@
$emcount = mysql_num_rows($emresult);
$headers = "From: {$_POST['from']}\r\n";
$headers .= "X-Mailer: $sitename Email Reminder";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=" .encode_lang($defaultlang) . "\r\n";
echo "<table width='500' align='center' bgcolor='#EEEEEE'>\n"
."\t<tr>\n"
."\t\t<td><font size='1'>\n";
Expand Down Expand Up @@ -871,6 +876,7 @@
// line endings. This converts them to just <LF> line endings. This is not correct, and may
// cause problems with certain email server
//$sendmessage = str_replace("\r", "", $sendmessage);
$msgsubject= encode_lang($defaultlang,$msgsubject);
if (mail($to, $msgsubject, $sendmessage, $headers))
{
echo "\t\t\t({$emrow['tid']})["._TC_REMINDSENTTO." {$emrow['firstname']} {$emrow['lastname']}]<br />\n";
Expand Down
8 changes: 7 additions & 1 deletion index.php
Expand Up @@ -833,7 +833,10 @@ function submittokens()
while ($cnfrow = mysql_fetch_array($cnfresult))
{
$headers = "From: {$thissurvey['adminname']} <{$thissurvey['adminemail']}>\r\n";
$headers .= "X-Mailer: $sitename Email Inviter";
$headers .= "X-Mailer: $sitename Email Inviter\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=" .encode_lang($thissurvey['language']) . "\r\n";

$to = $cnfrow['email'];
$subject = $thissurvey['email_confirm_subj'];
// $subject = _CONFIRMATION.": {$thissurvey['name']} "._SURVEYCPL;
Expand Down Expand Up @@ -910,6 +913,9 @@ function sendsubmitnotification($sendnotification)
$message.= "PHP Surveyor";
$message = crlf_lineendings($message);
$headers = "From: {$thissurvey['adminemail']}\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=" .encode_lang($thissurvey['language']) . "\r\n";

if ($recips=explode(";", $thissurvey['adminemail']))
{
foreach ($recips as $rc)
Expand Down

0 comments on commit bc5c4cd

Please sign in to comment.