Bob Osola <bobosola@gmail.com> (pngfix.js)
Sundar Dorai-Raj <sdoraira@vt.edu> (isNumeric() in functions.js)
+ Sean M. Burke. <sburke@cpan.org> (xsl_mop-up.js)
Other bundled libraries:
Script.aculo.us javascript library, http://http://script.aculo.us/
MagpieRSS feed parser, http://magpierss.sourceforge.net/
SimplePie feed parser, http://simplepie.org/
+ PHPMailer class, http://phpmailer.sourceforge.net/
Licensed under GNU GPL version 2
define('MAIL_RESET_PASS', true);
// Send mail to user on password reset
- define('MAIL_FROM', 'TT-RSS Daemon <noreply@some.ttrss.host.dom>');
- // Pretty obvious, I suppose. Used for email digests & password notifications.
-
define('ENABLE_FEED_BROWSER', true);
// Enable or disable local feed browser
define('DIGEST_ENABLE', true);
// Global option to enable daily digests
- define('DIGEST_HOSTNAME', 'some.ttrss.host.dom');
+ define('DIGEST_HOSTNAME', 'your.domain.dom');
// Hostname for email digest signature
define('DIGEST_EMAIL_LIMIT', 10);
// parameter to speed up tt-rss when having a huge number of articles
// in the database (better yet, enable purging!)
+ define('DIGEST_FROM_NAME', 'Tiny Tiny RSS');
+ define('DIGEST_FROM_ADDRESS', 'noreply@your.domain.dom');
+ // Name and address for sending email digests from.
+
+ define('DIGEST_SMTP_HOST', '');
+ // SMTP Host to send digests. When blank tt-rss uses
+ // PHP's default mail() function.
+
+ define('DIGEST_SMTP_LOGIN', '');
+ define('DIGEST_SMTP_PASSWORD', '');
+ // These two options enable SMTP authentication when sending
+ // digests. Require DIGEST_SMTP_HOST.
+
define('CONFIG_VERSION', 9);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
require_once 'errors.php';
require_once 'version.php';
+ require_once 'phpmailer/class.phpmailer.php';
+
define('MAGPIE_USER_AGENT_EXT', ' (Tiny Tiny RSS/' . VERSION . ')');
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
$headlines_count = $tuple[1];
if ($headlines_count > 0) {
- $rc = mail($line["login"] . " <" . $line["email"] . ">",
- "[tt-rss] New headlines for last 24 hours", $digest,
- "From: " . MAIL_FROM . "\n".
- "Content-Type: text/plain; charset=\"utf-8\"\n".
- "Content-Transfer-Encoding: 8bit\n");
+
+ if (!DIGEST_SMTP_HOST) {
+
+ $rc = mail($line["login"] . " <" . $line["email"] . ">",
+ "[tt-rss] New headlines for last 24 hours", $digest,
+ "From: " . DIGEST_FROM_NAME . " <" . DIGEST_FROM_ADDRESS . ">\n".
+ "Content-Type: text/plain; charset=\"utf-8\"\n".
+ "Content-Transfer-Encoding: 8bit\n");
+
+ } else {
+
+ $mail = new PHPMailer();
+
+ $mail->PluginDir = "phpmailer/";
+ $mail->SetLanguage("en", "phpmailer/language/");
+
+ $mail->From = DIGEST_FROM_ADDRESS;
+ $mail->FromName = DIGEST_FROM_NAME;
+ $mail->AddAddress($line["email"], $line["login"]);
+ $mail->Host = DIGEST_SMTP_HOST;
+ $mail->Mailer = "smtp";
+
+ $mail->Username = DIGEST_SMTP_LOGIN;
+ $mail->Password = DIGEST_SMTP_PASSWORD;
+
+ $mail->Subject = "[tt-rss] New headlines for last 24 hours";
+ $mail->Body = $digest;
+
+ $rc = $mail->Send();
+
+ if (!$rc) print "ERROR: " . $mail->ErrorInfo;
+
+ }
+
print "RC=$rc\n";
+
db_query($link, "UPDATE ttrss_users SET last_digest_sent = NOW()
WHERE id = " . $line["id"]);
} else {
ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id
AND include_in_digest = true
AND $interval_query
+ AND hidden = false
AND ttrss_user_entries.owner_uid = $user_id
AND unread = true ORDER BY ttrss_feeds.title, date_entered DESC
LIMIT $limit");
--- /dev/null
+<?php\r
+/**\r
+ * PHPMailer language file. \r
+ * English Version\r
+ */\r
+\r
+$PHPMAILER_LANG = array();\r
+\r
+$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .\r
+ 'recipient email address.';\r
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';\r
+$PHPMAILER_LANG["execute"] = 'Could not execute: ';\r
+$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';\r
+$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';\r
+$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';\r
+$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .\r
+ 'recipients failed: ';\r
+$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';\r
+$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';\r
+$PHPMAILER_LANG["file_access"] = 'Could not access file: ';\r
+$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';\r
+$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';\r
+?>\r
$err_msg = __("config: DATABASE_BACKED_SESSIONS are currently broken with MySQL");
}
+ if (defined('MAIL_FROM')) {
+ $err_msg = __("config: MAIL_FROM has been split into DIGEST_FROM_NAME and DIGEST_FROM_ADDRESS");
+ }
+
if ($err_msg) {
print "<b>".__("Fatal Error")."</b>: $err_msg\n";
exit;