Hello,
I'm trying to find a way to actually send the content of an article in an email instead of sending just the link. Is there a simple solution to this or is this a feature coming up in a later version? Thanks.
-Dan
Send email to friend WITH article content
Moderator: Thorsten
Hi Dan,
this feature is not currently planned.
BTW, locate, backup and open the file [PATH_TO_PMFINSTALL]/mailsend2friend.php and find these lines below:and change them to read:
That's all 
Ciao,
Matteo
this feature is not currently planned.
BTW, locate, backup and open the file [PATH_TO_PMFINSTALL]/mailsend2friend.php and find these lines below:
Code: Select all
...
$name = $db->escape_string(strip_tags($_POST["name"]));
$mailfrom = $db->escape_string(strip_tags($_POST["mailfrom"]));
$link = $db->escape_string(strip_tags($_POST["link"]));
$attached = $db->escape_string(strip_tags($_POST["zusatz"]));
$mailto = $_POST['mailto'];
...
mail($IDN->encode($mail), $PMF_LANG["msgS2FMailSubject"].$name, $PMF_CONF["send2friend_text"]."\n\n".$PMF_LANG["msgS2FText2"]."\n".$link."\n\n".$attached, "From: ".$IDN->encode($mailfrom));
...Code: Select all
...
$name = $db->escape_string(strip_tags($_POST["name"]));
$mailfrom = $db->escape_string(strip_tags($_POST["mailfrom"]));
$link = $db->escape_string(strip_tags($_POST["link"]));
$attached = $db->escape_string(strip_tags($_POST["zusatz"]));
$body = $PMF_CONF["send2friend_text"]."\n\n".$PMF_LANG["msgS2FText2"]."\n".$link."\n\n";
$isHTML = false;
$idx = preg_match('/action\=artikel&cat\=(\d+)&id\=(\d+)&artlang\=([a-z\-]+)/', $link, $matches);
$id = $matches[2];
$lang = $matches[3];
$query = sprintf("SELECT thema, content, active FROM %sfaqdata WHERE id = %d AND lang = '%s'", SQLPREFIX, $id, $lang);
$result = $db->query($query);
if ($row = $db->fetch_object($result)) {
if ('yes' == $row->active) {
$isHTML = true;
$content = $row->content;
$title = $row->thema;
}
}
$body .= "<br /><br />".$attached."<br /><br />".$content;
$headers = "From: ".$IDN->encode($mailfrom)."\r\n";
if ($isHTML) {
$boundary = uniqid("MAILSENDPMF");
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
// Plain text version of message
$headers .= "--$boundary\r\nContent-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode(strip_tags($body)))."\r\n";
// HTML version of message
$headers .= "--$boundary\r\nContent-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("<html><head><title>".htmlentities($title)."</title></head><body>".$body."</body></html>"."\r\n"));
$headers .= "--$boundary--\r\n";
}
$mailto = $_POST['mailto'];
...
mail($IDN->encode($mail), $PMF_LANG["msgS2FMailSubject"].$name, $body, $headers);
...Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Amazon.co.uk Wishlist