- if (!isset($config_php))
- include("../config/config.php");
- if (!isset($strings_php))
- include("../functions/strings.php");
- if (!isset($i18n_php))
- include("../functions/i18n.php");
- if (!isset($plugin_php))
- include("../functions/plugin.php");
+ $rcptaddress = '';
+ if (isset($emailaddress)) {
+ if (stristr($emailaddress, 'mailto:'))
+ $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);
+ }
+
+ require_once('../functions/strings.php');
+ require_once('../config/config.php');
+ require_once('../functions/i18n.php');
+ require_once('../functions/plugin.php');