Пример #1
0
                 } else {
                     $new_uid = db_fetch_result($result, 0, "id");
                     initialize_user($new_uid);
                     $reg_text = "Hi!\n" . "\n" . "You are receiving this message, because you (or somebody else) have opened\n" . "an account at Tiny Tiny RSS.\n" . "\n" . "Your login information is as follows:\n" . "\n" . "Login: {$login}\n" . "Password: {$password}\n" . "\n" . "Don't forget to login at least once to your new account, otherwise\n" . "it will be deleted in 24 hours.\n" . "\n" . "If that wasn't you, just ignore this message. Thanks.";
                     $mail = new ttrssMailer();
                     $mail->IsHTML(false);
                     $rc = $mail->quickMail($email, "", "Registration information for Tiny Tiny RSS", $reg_text, false);
                     if (!$rc) {
                         print_error($mail->ErrorInfo);
                     }
                     unset($reg_text);
                     unset($mail);
                     unset($rc);
                     $reg_text = "Hi!\n" . "\n" . "New user had registered at your Tiny Tiny RSS installation.\n" . "\n" . "Login: {$login}\n" . "Email: {$email}\n";
                     $mail = new ttrssMailer();
                     $mail->IsHTML(false);
                     $rc = $mail->quickMail(REG_NOTIFY_ADDRESS, "", "Registration notice for Tiny Tiny RSS", $reg_text, false);
                     if (!$rc) {
                         print_error($mail->ErrorInfo);
                     }
                     print_notice(__("Account created successfully."));
                     print "<p><form method=\"GET\" action=\"index.php\">\n\t\t\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t\t\t</form>";
                 }
             }
         } else {
             print_error('Plese check the form again, you have failed the robot test.');
             print "<p><form method=\"GET\" action=\"index.php\">\n\t\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t\t</form>";
         }
     }
 }
 ?>
 function sendEmail()
 {
     require_once 'classes/ttrssmailer.php';
     $reply = array();
     $mail = new ttrssMailer();
     $mail->From = strip_tags($_REQUEST['from_email']);
     $mail->FromName = strip_tags($_REQUEST['from_name']);
     //$mail->AddAddress($_REQUEST['destination']);
     $addresses = explode(';', $_REQUEST['destination']);
     foreach ($addresses as $nextaddr) {
         $mail->AddAddress($nextaddr);
     }
     $mail->IsHTML(false);
     $mail->Subject = $_REQUEST['subject'];
     $mail->Body = $_REQUEST['content'];
     $rc = $mail->Send();
     if (!$rc) {
         $reply['error'] = $mail->ErrorInfo;
     } else {
         save_email_address(db_escape_string($destination));
         $reply['message'] = "UPDATE_COUNTERS";
     }
     print json_encode($reply);
 }