$rcptaddress = substr($emailaddress, 7);
else
$rcptaddress = $emailaddress;
+
+ if (($pos = strpos($rcptaddress, '?')) !== false)
+ {
+ $a = substr($rcptaddress, $pos + 1);
+ $rcptaddress = substr($rcptaddress, 0, $pos);
+ $a = explode('=', $a, 2);
+ if (isset($a[1])) {
+ $name = urldecode($a[0]);
+ $val = urldecode($a[1]);
+ global $$name;
+ $$name = $val;
+ }
+ }
+
+ // At this point, we have parsed a lot of the mailto stuff. Let's
+ // do the rest -- CC, BCC, Subject, Body
+ // Note: They can all be case insensitive
+ foreach ($GLOBALS as $k => $v)
+ {
+ $key = strtolower($k);
+ $value = urlencode($v);
+ if ($key == 'cc')
+ $rcptaddress .= '&send_to_cc=' . $value;
+ elseif ($key == 'bcc')
+ $rcptaddress .= '&send_to_bcc=' . $value;
+ elseif ($key == 'subject')
+ $rcptaddress .= '&subject=' . $value;
+ elseif ($key == 'body')
+ $rcptaddress .= '&body=' . $value;
+ }
+
+ // Double-encode in this fashion to get past redirect.php properly
+ $rcptaddress = urlencode($rcptaddress);
}
include("../functions/strings.php");
session_register ('just_logged_in');
if(isset($rcptemail))
- header("Location: webmail.php?right_frame=compose.php&rcptaddress=$rcptemail");
+ header("Location: webmail.php?right_frame=compose.php&rcptaddress=" .
+ urlencode($rcptemail));
else
header("Location: webmail.php");
?>