if ($deliveryMethod == "wireless") { $mail->addTo('*****@*****.**'); $mail->addTo($username . "@kindle.com"); } else { $mail->addTo($username . "@free.kindle.com"); } $mail->setSubject("Sent via Readability: {$pageTitle}"); try { if (!$mail->send()) { Readability::logMessage("ERROR:There was an error sending to kindle. POST: " . print_r($_POST, true)); } else { $page = 'complete'; } } catch (Exception $e) { Readability::logMessage("ERROR:There was an exception sending the email. POST: " . print_r($_POST, true)); Readability::logMessage("ERROR:" . $e->getMessage()); } //header('location: close.html'); } } elseif ('get' == strtolower($_SERVER['REQUEST_METHOD'])) { $_SESSION['secureKey'] = Readability::generateSecureKey(); } class Readability { public static function isError($field, $errors) { if (in_array($field, $errors)) { return TRUE; } return FALSE; }