I changed the script a little:
Code:
if ($what=="download") {
if (is_array($privatemessage)) {
// header("Content-disposition: filename=messages.txt");
// header("Content-type: application/octet-stream");
// header("Pragma: no-cache");
// header("Expires: 0");
while(list($key,$val)=each($privatemessage)) {
$downloads=$DB_site->query_first("SELECT touserid,fromuserid,dateline,title,message FROM privatemessage WHERE privatemessageid='$key' AND userid=$bbuserinfo[userid]");
$tousername=$DB_site->query_first("SELECT username FROM user WHERE userid='$downloads[touserid]'");
$fromusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$downloads[fromuserid]'");
$msgdt = vbdate($dateformat,$downloads[dateline]);
$msgtm = vbdate($timeformat,$downloads[dateline]);
$wordwrap = wordwrap($downloads[message],75,"\r\n");
$dump .= "\r\nDate/Time Sent: $msgdt, $msgtm\r\n";
$dump .= "from: $fromusername[username]\r\n";
$dump .= "To: $tousername[username]\r\n";
$dump .= "Subject: $downloads[title]\r\n\r\n";
$dump .= "$wordwrap\r\n";
$dump .= "\r\n==========================================================================\r\n";
} //end while
mail("$bbuserinfo[email]","Download Private Messages","$dump","From: Title of your board <no_reply_emailaddress>");
eval("standarderror(\"".gettemplate("pm_download_complete")."\");");
exit;
} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}
Now the messages are send to the users emailaddress. In the template "pm_download_complete" you can warn them to check the email before deleting the messages.