Exemple #1
0
    // Get the HTML content
    $html = @PMF_Utils::getHTTPContent($link);
    // Try to attach the PDF content
    $pdfFile = $faq->buildPDFFile($cat);
    foreach ($mailto['mailto'] as $recipient) {
        $recipient = trim(strip_tags($recipient));
        if (!empty($recipient)) {
            $mail = new PMF_Mail();
            $mail->unsetFrom();
            $mail->setFrom($mailfrom, $name);
            $mail->addTo($recipient);
            $mail->subject = $PMF_LANG["msgS2FMailSubject"] . $name;
            $mail->message = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
            if ($html !== false) {
                $mail->messageAlt = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
                $mail->setHTMLMessage($html);
            }
            if (!empty($pdfFile) && file_exists($pdfFile)) {
                $mail->addAttachment($pdfFile, basename($pdfFile), 'application/pdf');
            }
            // Send the email
            $result = $mail->send();
            unset($mail);
            usleep(250);
        }
    }
    $tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'Message' => $PMF_LANG['msgS2FThx']));
} else {
    if (false === IPCheck($_SERVER["REMOTE_ADDR"])) {
        $tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'Message' => $PMF_LANG["err_bannedIP"]));
    } else {