From: Roland Häder Date: Sat, 21 Jun 2008 19:29:45 +0000 (+0000) Subject: Re-added with access protection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=758554bdbe167d7503552e086f7955a5e851f657;p=shipsimu.git Re-added with access protection --- diff --git a/.gitattributes b/.gitattributes index 8ce4323..95c4c0e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -360,6 +360,7 @@ inc/classes/main/commands/web/class_WebLoginCommand.php -text inc/classes/main/commands/web/class_WebLoginFailedCommand.php -text inc/classes/main/commands/web/class_WebLogoutDoneCommand.php -text inc/classes/main/commands/web/class_WebRegisterCommand.php -text +inc/classes/main/commands/web/class_WebResendLinkCommand.php -text inc/classes/main/compressor/.htaccess -text inc/classes/main/compressor/class_Bzip2Compressor.php -text inc/classes/main/compressor/class_GzipCompressor.php -text @@ -441,6 +442,7 @@ inc/classes/main/filter/verifier/class_EmailValidatorFilter.php -text inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php -text inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php -text inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php -text +inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php -text inc/classes/main/helper/.htaccess -text inc/classes/main/helper/class_ -text inc/classes/main/helper/class_BaseHelper.php -text @@ -502,10 +504,29 @@ inc/classes/middleware/debug/class_DebugMiddleware.php -text inc/classes/middleware/io/.htaccess -text inc/classes/middleware/io/class_FileIoHandler.php -text inc/classes/third_party/.htaccess -text +inc/classes/third_party/php_mailer/.htaccess -text +inc/classes/third_party/php_mailer/ChangeLog.txt -text inc/classes/third_party/php_mailer/LICENSE -text +inc/classes/third_party/php_mailer/README -text inc/classes/third_party/php_mailer/class.phpmailer.php -text inc/classes/third_party/php_mailer/class.pop3.php -text inc/classes/third_party/php_mailer/class.smtp.php -text +inc/classes/third_party/php_mailer/docs/extending.html -text +inc/classes/third_party/php_mailer/docs/faq.html -text +inc/classes/third_party/php_mailer/docs/pop3_article.txt -text +inc/classes/third_party/php_mailer/docs/use_gmail.txt -text +inc/classes/third_party/php_mailer/examples/contents.html -text +inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif -text +inc/classes/third_party/php_mailer/examples/images/phpmailer.gif -text +inc/classes/third_party/php_mailer/examples/images/phpmailer.png -text +inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif -text +inc/classes/third_party/php_mailer/examples/index.html -text +inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php -text +inc/classes/third_party/php_mailer/examples/test_gmail.php -text +inc/classes/third_party/php_mailer/examples/test_mail.php -text +inc/classes/third_party/php_mailer/examples/test_sendmail.php -text +inc/classes/third_party/php_mailer/examples/test_smtp.php -text +inc/classes/third_party/php_mailer/language/.htaccess -text inc/classes/third_party/php_mailer/language/phpmailer.lang-br.php -text inc/classes/third_party/php_mailer/language/phpmailer.lang-ca.php -text inc/classes/third_party/php_mailer/language/phpmailer.lang-cz.php -text @@ -527,6 +548,23 @@ inc/classes/third_party/php_mailer/language/phpmailer.lang-ro.php -text inc/classes/third_party/php_mailer/language/phpmailer.lang-ru.php -text inc/classes/third_party/php_mailer/language/phpmailer.lang-se.php -text inc/classes/third_party/php_mailer/language/phpmailer.lang-tr.php -text +inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html -text +inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html -text +inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html -text +inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html -text +inc/classes/third_party/php_mailer/phpdoc/blank.html -text +inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html -text +inc/classes/third_party/php_mailer/phpdoc/elementindex.html -text +inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html -text +inc/classes/third_party/php_mailer/phpdoc/errors.html -text +inc/classes/third_party/php_mailer/phpdoc/index.html -text +inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html -text +inc/classes/third_party/php_mailer/phpdoc/media/banner.css -text +inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css -text +inc/classes/third_party/php_mailer/phpdoc/packages.html -text +inc/classes/third_party/php_mailer/test/phpmailer_test.php -text +inc/classes/third_party/php_mailer/test/phpunit.php -text +inc/classes/third_party/php_mailer/test/test.png -text inc/config.php -text inc/config/.htaccess -text inc/config/class_FrameworkConfiguration.php -text diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index b373a1b..5fbe876 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -85,10 +85,10 @@ $cfg->setConfigEntry('user_status_guest', "GUEST"); // CFG: USER-STATUS-CONFIRMED $cfg->setConfigEntry('user_status_confirmed', "CONFIRMED"); -// CFG: LOGIN-HELPER +// CFG: LOGIN-HELPER-CLASS $cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper"); -// CFG: LOGIN-METHOD +// CFG: AUTH-METHOD-CLASS $cfg->setConfigEntry('auth_method_class', "CookieAuth"); // CFG: APP-LOGIN-URL @@ -103,6 +103,9 @@ $cfg->setConfigEntry('logout_done_url', "index.php?app=ship-simu&page=logout_don // CFG: LOGIN-USER-STATUS-URL $cfg->setConfigEntry('login_user_status_url', "index.php?app=ship-simu&page=login_area&action=status_problem"); +// CFG: LOGIN-USER-UNCONFIRMED-URL +$cfg->setConfigEntry('login_user_unconfirmed_url', "index.php?app=ship-simu&page=status_unconfirmed_problem"); + // CFG: LOGIN-DEFAULT-ACTION $cfg->setConfigEntry('login_default_action', "welcome"); diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php index 1e094cb..72471e5 100644 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuUserLogin.php @@ -68,10 +68,6 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { * @param $requestInstance An instance of a Requestable class * @param $responseInstance An instance of a Responseable class * @return void - * @throws UserAuthMethodException If wether username nor email login - * was detected - * @throws MissingMethodException If a method was not found in the - * User class * @throws UserPasswordMismatchException If the supplied password did not * match with the stored password * @todo We need to add something here which will make more than one @@ -83,33 +79,13 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { $method = null; $data = ""; - // Detect login method (username or email) and try to get a userinstance - if (!is_null($requestInstance->getRequestElement('username'))) { - // Username found! - $method = "createUserByUsername"; - $data = $requestInstance->getRequestElement('username'); - } elseif (!is_null($requestInstance->getRequestElement('email'))) { - // Email found! - $method = "createUserByEmail"; - $data = $requestInstance->getRequestElement('email'); - } - - // Is a method detected? - if (is_null($method)) { - // Then abort here - throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD); - } elseif (!method_exists($this->getConfigInstance()->readConfig('user_class'), $method)) { - // The method is invalid! - throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD); - } - // Get a instance of the registry $userInstance = Registry::getRegistry()->getInstance('user'); // Is there an instance? if (is_null($userInstance)) { // Get a user instance - $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), $method), array($data)); + $userInstance = User::createUserByRequest($requestInstance); // Remember this new instance in registry Registry::getRegistry()->addInstance($userInstance); diff --git a/application/ship-simu/templates/de/code/login_status_problem.ctp b/application/ship-simu/templates/de/code/login_status_problem.ctp index 2539609..e8de120 100644 --- a/application/ship-simu/templates/de/code/login_status_problem.ctp +++ b/application/ship-simu/templates/de/code/login_status_problem.ctp @@ -9,13 +9,17 @@ $helper->prefetchFieldValues('user'); // Add submit button or notice if ($helper->ifUserAccountUnconfirmed()) { + // Add submit button + $helper->addInputHiddenFieldWithDefault("email"); $helper->addInputSubmitButton("Bestätigungslink erneut aussenden"); } elseif ($helper->ifUserAccountLocked()) { + // Account is locked $helper->addFormNote("Dein Account wurde gesperrt! Grund der Sperre: ".$helper->getField('lock_reason')." Bitte melde dich beim Support, damit dieser dir weiterhelfen kann." ); } elseif ($helper->ifUserAccountGuest()) { + // Account is guest account $helper->addFormNote("Gästeaccounts sind in der Funktionalität leicht eingeschränkt. Bitte melde dich an, damit du ein vollwertiges Account bekommst." diff --git a/inc/classes/exceptions/main/class_InvalidCommandException.php b/inc/classes/exceptions/main/class_InvalidCommandException.php index 1d53b72..9a1e9e2 100644 --- a/inc/classes/exceptions/main/class_InvalidCommandException.php +++ b/inc/classes/exceptions/main/class_InvalidCommandException.php @@ -31,10 +31,11 @@ class InvalidCommandException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Invalid command %s detected.", + $message = sprintf("[%s:%d] Invalid command %s (class %s) detected.", $msgArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $msgArray[1], + $msgArray[0]->getClassName() ); // Call parent constructor diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 148b72a..63a86a7 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -144,7 +144,6 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. - //$templateInstance->debugInstance(); $templateInstance->compileVariables(); // Get the content back from the template engine and put it in the response class diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php new file mode 100644 index 0000000..ba9f9f5 --- /dev/null +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -0,0 +1,86 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebResendLinkCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set special description + $this->setObjectDescription("Command for resending confirmation link"); + + // Create unique ID number + $this->generateUniqueId(); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public final static function createWebResendLinkCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebResendLinkCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + $this->debugInstance(); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Filter for checking if account is unconfirmed + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class')); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php new file mode 100644 index 0000000..c7d060c --- /dev/null +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -0,0 +1,84 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("A filter for checking if the user account is unconfirmed"); + + // Create unique ID number + $this->generateUniqueId(); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createUserUnconfirmedVerifierFilter () { + // Get a new instance + $filterInstance = new UserUnconfirmedVerifierFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get a user instance for comparison + $userInstance = User::createUserByRequest($requestInstance); + + // Is the user account confirmed? + if ($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_unconfirmed')) { + // Request is invalid! + $requestInstance->requestIsValid(false); + + // Redirect to configured URL + $responseInstance->redirectToConfiguredUrl('login_user_unconfirmed_url'); + + // Stop processing here + exit(); + } // END - if + } +} + +// [EOF] +?> diff --git a/inc/classes/main/helper/web/class_WebFormHelper.php b/inc/classes/main/helper/web/class_WebFormHelper.php index c8c7448..32d635a 100644 --- a/inc/classes/main/helper/web/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/class_WebFormHelper.php @@ -278,6 +278,21 @@ class WebFormHelper extends BaseHelper { $this->addContent($inputContent); } + /** + * Add a hidden input tag to the form with pre-loaded default value + * + * @param $fieldName Input field name + * @return void + */ + public function addInputHiddenFieldWithDefault ($fieldName) { + // Get the value from instance + $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName)); + //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."
\n"; + + // Add the text field + $this->addInputHiddenField($fieldName, $fieldValue); + } + /** * Add a checkbox input tag to the form or throw an exception if it is not * yet opened. The field's name will be set as id. diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index 83aa964..5c3aaa7 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -90,13 +90,13 @@ class BaseActionResolver extends BaseResolver { } // END - if // Now, let us create the full name of the action class - $className = sprintf("%s%sAction", + $this->setClassName(sprintf("%s%sAction", $this->actionPrefix, $this->convertToClassName($actionName) - ); + )); // Is this class already loaded? - if (class_exists($className)) { + if (class_exists($this->getClassName())) { // This class does exist. :-) $isValid = true; } // END - if @@ -123,12 +123,12 @@ class BaseActionResolver extends BaseResolver { $actionInstance = null; // Create action class name - $className = sprintf("Web%sAction", + $this->setClassName(sprintf("Web%sAction", $this->convertToClassName($this->getActionName()) - ); + )); // Initiate the action - $actionInstance = ObjectFactory::createObjectByName($className, array($this)); + $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); // Return the result return $actionInstance; diff --git a/inc/classes/main/resolver/class_BaseResolver.php b/inc/classes/main/resolver/class_BaseResolver.php index 305b279..eedeef3 100644 --- a/inc/classes/main/resolver/class_BaseResolver.php +++ b/inc/classes/main/resolver/class_BaseResolver.php @@ -22,6 +22,11 @@ * along with this program. If not, see . */ class BaseResolver extends BaseFrameworkSystem { + /** + * Class name + */ + private $className = ""; + // Exception constants const EXCEPTION_INVALID_COMMAND = 0x0c0; const EXCEPTION_INVALID_CONTROLLER = 0x0c1; @@ -41,6 +46,25 @@ class BaseResolver extends BaseFrameworkSystem { $this->removeNumberFormaters(); $this->removeSystemArray(); } + + /** + * Setter for class name + * + * @param $className Name of the class + * @return void + */ + protected final function setClassName ($className) { + $this->className = $className; + } + + /** + * Getter for class name + * + * @return $className Name of the class + */ + public final function getClassName () { + return $this->className; + } } // [EOF] diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index 4ad1d3e..7493507 100644 --- a/inc/classes/main/resolver/command/class_BaseCommandResolver.php +++ b/inc/classes/main/resolver/command/class_BaseCommandResolver.php @@ -114,13 +114,13 @@ class BaseCommandResolver extends BaseResolver { } // Now, let us create the full name of the command class - $className = sprintf("%s%sCommand", + $this->setClassName(sprintf("%s%sCommand", $this->commandPrefix, $this->convertToClassName($commandName) - ); + )); // Is this class already loaded? - if (class_exists($className)) { + if (class_exists($this->getClassName())) { // This class does exist. :-) $isValid = true; } // END - if diff --git a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php index d1ee1e6..acb6e52 100644 --- a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php @@ -25,7 +25,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver /** * Last successfull resolved command */ - private $lastCommandInstance = ""; + private $lastCommandInstance = null; /** * Protected constructor @@ -162,12 +162,12 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver $commandInstance = null; // Create command class name - $className = sprintf("Web%sCommand", + $this->setClassName(sprintf("Web%sCommand", $this->convertToClassName($commandName) - ); + )); // Is this class loaded? - if (!class_exists($className)) { + if (!class_exists($this->getClassName())) { // Class not found, so try the default one or throw exception if ($commandName != $defaultCommand) { // Try the default command @@ -179,7 +179,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver } // END - if // Initiate the command - $commandInstance = ObjectFactory::createObjectByName($className, array($this)); + $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); // Return the result return $commandInstance; diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index f584975..7a7d026 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -90,25 +90,25 @@ class BaseControllerResolver extends BaseResolver { } // END - if // Now, let us create the full name of the controller class - $className = sprintf("%s%sController", + $this->setClassName(sprintf("%s%sController", $this->controllerPrefix, $this->convertToClassName($controllerName) - ); + )); // Try it hard to get an controller while (!$isValid) { // Is this class already loaded? - if (class_exists($className)) { + if (class_exists($this->getClassName())) { // This class does exist. :-) $isValid = true; - } elseif (($className != "WebDefaultController") && ($className != "WebDefaultNewsController")) { + } elseif (($this->getClassName() != "WebDefaultController") && ($this->getClassName() != "WebDefaultNewsController")) { // Do we have news? if ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) { // Yes, display news in home then set default controller with news - $className = "WebDefaultNewsController"; + $this->setClassName("WebDefaultNewsController"); } else { // No news at "home" page or non-news page - $className = "WebDefaultController"; + $this->setClassName("WebDefaultController"); } } else { // All is tried, give it up here diff --git a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php index eec9884..2b0c17d 100644 --- a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php +++ b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php @@ -136,26 +136,26 @@ class WebControllerResolver extends BaseControllerResolver implements Controller $controllerInstance = null; // Default controller - $className = "WebDefaultController"; + $this->setClassName("WebDefaultController"); // Generate the class name //* DEBUG: */ echo __METHOD__.": Controller=".$controllerName; if ($controllerName != $defaultController) { // Create controller class name - $className = sprintf("Web%sController", + $this->setClassName(sprintf("Web%sController", $this->convertToClassName($controllerName) - ); + )); } elseif ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) { // Yes, display news in home then set default controller with news - $className = "WebDefaultNewsController"; + $this->setClassName("WebDefaultNewsController"); } else { // No news at "home" page or non-news page - $className = "WebDefaultController"; + $this->setClassName("WebDefaultController"); } - //* DEBUG: */ echo ", controller=".$className."
\n"; + //* DEBUG: */ echo ", controller=".$this->getClassName()."
\n"; // Is this class loaded? - if (!class_exists($className)) { + if (!class_exists($this->getClassName())) { // Class not found, so try the default one or throw exception if ($controllerName != $defaultController) { // Try the default controller @@ -168,7 +168,7 @@ class WebControllerResolver extends BaseControllerResolver implements Controller // Initiate the resolver and controller $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($controllerName, $this->getApplicationInstance())); - $controllerInstance = ObjectFactory::createObjectByName($className, array($resolverInstance)); + $controllerInstance = ObjectFactory::createObjectByName($this->getClassName(), array($resolverInstance)); // Remove resolver unset($resolverInstance); diff --git a/inc/classes/main/user/class_User.php b/inc/classes/main/user/class_User.php index 3bc8388..d82f5ab 100644 --- a/inc/classes/main/user/class_User.php +++ b/inc/classes/main/user/class_User.php @@ -110,6 +110,32 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable { return $userInstance; } + /** + * Creates a user by a given request instance + * + * @param $requestInstance An instance of a Requestable class + * @return $userInstance An instance of this user class + */ + public final static function createUserByRequest (Requestable $requestInstance) { + // Determine if by email or username + if (!is_null($requestInstance->getRequestElement('username'))) { + // Username supplied + $userInstance = self::createUserByUserName($requestInstance->getRequestElement('username')); + } elseif (!is_null($requestInstance->getRequestElement('email'))) { + // Email supplied + $userInstance = self::createUserByEmail($requestInstance->getRequestElement('email')); + } else { + // Unsupported mode + $userInstance = new User(); + $userInstance->partialStub("We need to add more ways of creating user accounts here."); + $userInstance->debugBackTrace(); + exit(); + } + + // Return the prepared instance + return $userInstance; + } + /** * "Getter" for databse entry * diff --git a/inc/classes/third_party/php_mailer/.htaccess b/inc/classes/third_party/php_mailer/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/third_party/php_mailer/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/third_party/php_mailer/ChangeLog.txt b/inc/classes/third_party/php_mailer/ChangeLog.txt new file mode 100644 index 0000000..377ac5b --- /dev/null +++ b/inc/classes/third_party/php_mailer/ChangeLog.txt @@ -0,0 +1,307 @@ +/******************************************************************* +* The http://phpmailer.codeworxtech.com/ website now carries a few * +* advertisements through the Google Adsense network. Please visit * +* the advertiser sites and help us offset some of our costs. * +* Thanks .... * +********************************************************************/ + +ChangeLog + +NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5. IT WILL NOT WORK WITH PHP4. + +Version 2.1 (Wed, June 04 2008) + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +* added S/MIME functionality (ability to digitally sign emails) + BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. + The "Signed Emails" functionality adds the Sign method to pass the private key + filename and the password to read it, and then email will be sent with + content-type multipart/signed and with the digital signature attached. +* fully compatible with E_STRICT error level + - Please note: + In about half the test environments this development version was subjected + to, an error was thrown for the date() functions used (line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, to your own server timezone + - If you do get this error, and are unable to access your php.ini file: + In your PHP script, add + date_default_timezone_set('America/Toronto'); + - do not try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. +* added ability to define path (mainly for embedded images) + function MsgHTML($message,$basedir='') ... where: + $basedir is the fully qualified path +* fixed MsgHTML() function: + - Embedded Images where images are specified by :// will not be altered or embedded +* fixed the return value of SMTP exit code ( pclose ) +* addressed issue of multibyte characters in subject line and truncating +* added ability to have user specified Message ID + (default is still that PHPMailer create a unique Message ID) +* corrected unidentified message type to 'application/octet-stream' +* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). +* added check for added attachments +* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") + +Version 2.1.0beta2 (Sun, Dec 02 2007) +* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) +* finished all testing, all known bugs corrected, enhancements tested +- note: will NOT work with PHP4. + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.1.0beta1 +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release +* implements new property to control VERP in class.smtp.php + example (requires instantiating class.smtp.php): + $mail->do_verp = true; +* POP-before-SMTP functionality included, thanks to Richard Davey + (see class.pop3.php & pop3_before_smtp_test.php for examples) +* included example showing how to use PHPMailer with GMAIL +* fixed the missing Cc in SendMail() and Mail() + +****************** +A note on sending bulk emails: + +If the email you are sending is not personalized, consider using the +"undisclosed-recipient:;" strategy. That is, put all of your recipients +in the Bcc field and set the To field to "undisclosed-recipients:;". +It's a lot faster (only one send) and saves quite a bit on resources. +Contrary to some opinions, this will not get you listed in spam engines - +it's a legitimate way for you to send emails. + +A partial example for use with PHPMailer: + +$mail->AddAddress("undisclosed-recipients:;"); +$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); + +Many email service providers restrict the number of emails that can be sent +in any given time period. Often that is between 50 - 60 emails maximum +per hour or per send session. + +If that's the case, then break up your Bcc lists into chunks that are one +less than your limit, and put a pause in your script. +******************* + +Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release +* dramatically simplified using inline graphics ... it's fully automated and requires no user input +* added automatic document type detection for attachments and pictures +* added MsgHTML() function to replace Body tag for HTML emails +* fixed the SendMail security issues (input validation vulnerability) +* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address +* removed the need to use the AltBody method (set from the HTML, or default text used) +* set the PHP Mail() function as the default (still support SendMail, SMTP Mail) +* removed the need to set the IsHTML property (set automatically) +* added Estonian language file by Indrek Päri +* added header injection patch +* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. + example of use: + $mail->set('X-Priority', '3'); + $mail->set('X-MSMail-Priority', 'Normal'); +* fixed warning message in SMTP get_lines method +* added TLS/SSL SMTP support + example of use: + $mail = new PHPMailer(); + $mail->Mailer = "smtp"; + $mail->Host = "smtp.example.com"; + $mail->SMTPSecure = "tls"; // option + //$mail->SMTPSecure = "ssl"; // option + ... + $mail->Send(); +* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) +* Works with PHP installed as a module or as CGI-PHP +- NOTE: will NOT work with PHP5 in E_STRICT error mode + +Version 1.73 (Sun, Jun 10 2005) +* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf +* Now has a total of 20 translations +* Fixed alt attachments bug: http://tinyurl.com/98u9k + +Version 1.72 (Wed, May 25 2004) +* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. +* Received: Removed this method because spam filter programs like +SpamAssassin reject this header. +* Fixed error count bug. +* SetLanguage default is now "language/". +* Fixed magic_quotes_runtime bug. + +Version 1.71 (Tue, Jul 28 2003) +* Made several speed enhancements +* Added German and Italian translation files +* Fixed HELO/AUTH bugs on keep-alive connects +* Now provides an error message if language file does not load +* Fixed attachment EOL bug +* Updated some unclear documentation +* Added additional tests and improved others + +Version 1.70 (Mon, Jun 20 2003) +* Added SMTP keep-alive support +* Added IsError method for error detection +* Added error message translation support (SetLanguage) +* Refactored many methods to increase library performance +* Hello now sends the newer EHLO message before HELO as per RFC 2821 +* Removed the boundary class and replaced it with GetBoundary +* Removed queue support methods +* New $Hostname variable +* New Message-ID header +* Received header reformat +* Helo variable default changed to $Hostname +* Removed extra spaces in Content-Type definition (#667182) +* Return-Path should be set to Sender when set +* Adds Q or B encoding to headers when necessary +* quoted-encoding should now encode NULs \000 +* Fixed encoding of body/AltBody (#553370) +* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) +* Multiple bug fixes + +Version 1.65 (Fri, Aug 09 2002) +* Fixed non-visible attachment bug (#585097) for Outlook +* SMTP connections are now closed after each transaction +* Fixed SMTP::Expand return value +* Converted SMTP class documentation to phpDocumentor format + +Version 1.62 (Wed, Jun 26 2002) +* Fixed multi-attach bug +* Set proper word wrapping +* Reduced memory use with attachments +* Added more debugging +* Changed documentation to phpDocumentor format + +Version 1.60 (Sat, Mar 30 2002) +* Sendmail pipe and address patch (Christian Holtje) +* Added embedded image and read confirmation support (A. Ognio) +* Added unit tests +* Added SMTP timeout support (*nix only) +* Added possibly temporary PluginDir variable for SMTP class +* Added LE message line ending variable +* Refactored boundary and attachment code +* Eliminated SMTP class warnings +* Added SendToQueue method for future queuing support + +Version 1.54 (Wed, Dec 19 2001) +* Add some queuing support code +* Fixed a pesky multi/alt bug +* Messages are no longer forced to have "To" addresses + +Version 1.50 (Thu, Nov 08 2001) +* Fix extra lines when not using SMTP mailer +* Set WordWrap variable to int with a zero default + +Version 1.47 (Tue, Oct 16 2001) +* Fixed Received header code format +* Fixed AltBody order error +* Fixed alternate port warning + +Version 1.45 (Tue, Sep 25 2001) +* Added enhanced SMTP debug support +* Added support for multiple ports on SMTP +* Added Received header for tracing +* Fixed AddStringAttachment encoding +* Fixed possible header name quote bug +* Fixed wordwrap() trim bug +* Couple other small bug fixes + +Version 1.41 (Wed, Aug 22 2001) +* Fixed AltBody bug w/o attachments +* Fixed rfc_date() for certain mail servers + +Version 1.40 (Sun, Aug 12 2001) +* Added multipart/alternative support (AltBody) +* Documentation update +* Fixed bug in Mercury MTA + +Version 1.29 (Fri, Aug 03 2001) +* Added AddStringAttachment() method +* Added SMTP authentication support + +Version 1.28 (Mon, Jul 30 2001) +* Fixed a typo in SMTP class +* Fixed header issue with Imail (win32) SMTP server +* Made fopen() calls for attachments use "rb" to fix win32 error + +Version 1.25 (Mon, Jul 02 2001) +* Added RFC 822 date fix (Patrice) +* Added improved error handling by adding a $ErrorInfo variable +* Removed MailerDebug variable (obsolete with new error handler) + +Version 1.20 (Mon, Jun 25 2001) +* Added quoted-printable encoding (Patrice) +* Set Version as public and removed PrintVersion() +* Changed phpdoc to only display public variables and methods + +Version 1.19 (Thu, Jun 21 2001) +* Fixed MS Mail header bug +* Added fix for Bcc problem with mail(). *Does not work on Win32* + (See PHP bug report: http://www.php.net/bugs.php?id=11616) +* mail() no longer passes a fifth parameter when not needed + +Version 1.15 (Fri, Jun 15 2001) +[Note: these changes contributed by Patrice Fournier] +* Changed all remaining \n to \r\n +* Bcc: header no longer writen to message except +when sent directly to sendmail +* Added a small message to non-MIME compliant mail reader +* Added Sender variable to change the Sender email +used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode +* Changed boundary setting to a place it will be set only once +* Removed transfer encoding for whole message when using multipart +* Message body now uses Encoding in multipart messages +* Can set encoding and type to attachments 7bit, 8bit +and binary attachment are sent as is, base64 are encoded +* Can set Encoding to base64 to send 8 bits body +through 7 bits servers + +Version 1.10 (Tue, Jun 12 2001) +* Fixed win32 mail header bug (printed out headers in message body) + +Version 1.09 (Fri, Jun 08 2001) +* Changed date header to work with Netscape mail programs +* Altered phpdoc documentation + +Version 1.08 (Tue, Jun 05 2001) +* Added enhanced error-checking +* Added phpdoc documentation to source + +Version 1.06 (Fri, Jun 01 2001) +* Added optional name for file attachments + +Version 1.05 (Tue, May 29 2001) +* Code cleanup +* Eliminated sendmail header warning message +* Fixed possible SMTP error + +Version 1.03 (Thu, May 24 2001) +* Fixed problem where qmail sends out duplicate messages + +Version 1.02 (Wed, May 23 2001) +* Added multiple recipient and attachment Clear* methods +* Added Sendmail public variable +* Fixed problem with loading SMTP library multiple times + +Version 0.98 (Tue, May 22 2001) +* Fixed problem with redundant mail hosts sending out multiple messages +* Added additional error handler code +* Added AddCustomHeader() function +* Added support for Microsoft mail client headers (affects priority) +* Fixed small bug with Mailer variable +* Added PrintVersion() function + +Version 0.92 (Tue, May 15 2001) +* Changed file names to class.phpmailer.php and class.smtp.php to match + current PHP class trend. +* Fixed problem where body not being printed when a message is attached +* Several small bug fixes + +Version 0.90 (Tue, April 17 2001) +* Intial public release diff --git a/inc/classes/third_party/php_mailer/README b/inc/classes/third_party/php_mailer/README new file mode 100644 index 0000000..3670fb6 --- /dev/null +++ b/inc/classes/third_party/php_mailer/README @@ -0,0 +1,178 @@ +/******************************************************************* +* The http://phpmailer.codeworxtech.com/ website now carries a few * +* advertisements through the Google Adsense network. Please visit * +* the advertiser sites and help us offset some of our costs. * +* Thanks .... * +********************************************************************/ + +PHPMailer +Full Featured Email Transfer Class for PHP +========================================== + +Version 2.1 (June 04 2008) + +With this release, we are announcing that the development of PHPMailer for PHP5 +will be our focus from this date on. We have implemented all the enhancements +and fixes from the latest release of PHPMailer for PHP4. + +Far more important, though, is that this release of PHPMailer (v2.1) is +fully tested with E_STRICT error checking enabled. + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +We have now added S/MIME functionality (ability to digitally sign emails). +BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. +The "Signed Emails" functionality adds the Sign method to pass the private key +filename and the password to read it, and then email will be sent with +content-type multipart/signed and with the digital signature attached. + +A quick note on E_STRICT: + +- In about half the test environments the development version was subjected + to, an error was thrown for the date() functions (used at line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, (for your own server timezone) +- If you do get this error, and are unable to access your php.ini file, there is + a workaround. In your PHP script, add + date_default_timezone_set('America/Toronto'); + + * do NOT try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. + +We have also included more example files to show the use of "sendmail", "mail()", +"smtp", and "gmail". + +We are also looking for more programmers to join the volunteer development team. +If you have an interest in this, please let us know. + +Enjoy! + + +Version 2.1.0beta1 & beta2 + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +** NOTE: + +As of November 2007, PHPMailer has a new project team headed by industry +veteran Andy Prevost (codeworxtech). The first release in more than two +years will focus on fixes, adding ease-of-use enhancements, provide +basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility +features. A new release is planned before year-end 2007 that will provide +full compatiblity with PHP4 and PHP5, as well as more bug fixes. + +We are looking for project developers to assist in restoring PHPMailer to +its leadership position. Our goals are to simplify use of PHPMailer, provide +good documentation and examples, and retain backward compatibility to level +1.7.3 standards. + +If you are interested in helping out, visit http://sourceforge.net/phpmailer +and indicate your interest. + +** + +http://phpmailer.sourceforge.net/ + +This software is licenced under the LGPL. Please read LICENSE for information on the +software availability and distribution. + +Class Features: +- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs +- Redundant SMTP servers +- Multipart/alternative emails for mail clients that do not read HTML email +- Support for 8bit, base64, binary, and quoted-printable encoding +- Uses the same methods as the very popular AspEmail active server (COM) component +- SMTP authentication +- Native language support +- Word wrap, and more! + +Why you might need it: + +Many PHP developers utilize email in their code. The only PHP function +that supports this is the mail() function. However, it does not expose +any of the popular features that many email clients use nowadays like +HTML-based emails and attachments. There are two proprietary +development tools out there that have all the functionality built into +easy to use classes: AspEmail(tm) and AspMail. Both of these +programs are COM components only available on Windows. They are also a +little pricey for smaller projects. + +Since I do Linux development I’ve missed these tools for my PHP coding. +So I built a version myself that implements the same methods (object +calls) that the Windows-based components do. It is open source and the +LGPL license allows you to place the class in your proprietary PHP +projects. + + +Installation: + +Copy class.phpmailer.php into your php.ini include_path. If you are +using the SMTP mailer then place class.smtp.php in your path as well. +In the language directory you will find several files like +phpmailer.lang-en.php. If you look right before the .php extension +that there are two letters. These represent the language type of the +translation file. For instance "en" is the English file and "br" is +the Portuguese file. Chose the file that best fits with your language +and place it in the PHP include path. If your language is English +then you have nothing more to do. If it is a different language then +you must point PHPMailer to the correct translation. To do this, call +the PHPMailer SetLanguage method like so: + +// To load the Portuguese version +$mail->SetLanguage("br", "/optional/path/to/language/directory/"); + +That's it. You should now be ready to use PHPMailer! + + +A Simple Example: + +IsSMTP(); // set mailer to use SMTP +$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server +$mail->SMTPAuth = true; // turn on SMTP authentication +$mail->Username = "jswan"; // SMTP username +$mail->Password = "secret"; // SMTP password + +$mail->From = "from@example.com"; +$mail->FromName = "Mailer"; +$mail->AddAddress("josh@example.net", "Josh Adams"); +$mail->AddAddress("ellen@example.com"); // name is optional +$mail->AddReplyTo("info@example.com", "Information"); + +$mail->WordWrap = 50; // set word wrap to 50 characters +$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments +$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name +$mail->IsHTML(true); // set email format to HTML + +$mail->Subject = "Here is the subject"; +$mail->Body = "This is the HTML message body in bold!"; +$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; + +if(!$mail->Send()) +{ + echo "Message could not be sent.

"; + echo "Mailer Error: " . $mail->ErrorInfo; + exit; +} + +echo "Message has been sent"; +?> + +CHANGELOG + +See ChangeLog.txt + +Download: http://sourceforge.net/project/showfiles.php?group_id=26031 + +Andy Prevost diff --git a/inc/classes/third_party/php_mailer/docs/extending.html b/inc/classes/third_party/php_mailer/docs/extending.html new file mode 100644 index 0000000..f7c3200 --- /dev/null +++ b/inc/classes/third_party/php_mailer/docs/extending.html @@ -0,0 +1,148 @@ + + +Examples using phpmailer + + + + +

Examples using phpmailer

+ +

1. Advanced Example

+

+ +This demonstrates sending out multiple email messages with binary attachments +from a MySQL database with multipart/alternative support.

+ + + + +
+
+require("class.phpmailer.php");
+
+$mail = new phpmailer();
+
+$mail->From     = "list@example.com";
+$mail->FromName = "List manager";
+$mail->Host     = "smtp1.example.com;smtp2.example.com";
+$mail->Mailer   = "smtp";
+
+@MYSQL_CONNECT("localhost","root","password");
+@mysql_select_db("my_company");
+$query  = "SELECT full_name, email, photo FROM employee WHERE id=$id";
+$result = @MYSQL_QUERY($query);
+
+while ($row = mysql_fetch_array ($result))
+{
+    // HTML body
+    $body  = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
+    $body .= "<i>Your</i> personal photograph to this message.<p>";
+    $body .= "Sincerely, <br>";
+    $body .= "phpmailer List manager";
+
+    // Plain text body (for mail clients that cannot read HTML)
+    $text_body  = "Hello " . $row["full_name"] . ", \n\n";
+    $text_body .= "Your personal photograph to this message.\n\n";
+    $text_body .= "Sincerely, \n";
+    $text_body .= "phpmailer List manager";
+
+    $mail->Body    = $body;
+    $mail->AltBody = $text_body;
+    $mail->AddAddress($row["email"], $row["full_name"]);
+    $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
+
+    if(!$mail->Send())
+        echo "There has been a mail error sending to " . $row["email"] . "<br>";
+
+    // Clear all addresses and attachments for next loop
+    $mail->ClearAddresses();
+    $mail->ClearAttachments();
+}
+
+
+

+ +

2. Extending phpmailer

+

+ +Extending classes with inheritance is one of the most +powerful features of object-oriented +programming. It allows you to make changes to the +original class for your +own personal use without hacking the original +classes. Plus, it is very +easy to do. I've provided an example: + +

+Here's a class that extends the phpmailer class and sets the defaults +for the particular site:
+PHP include file: mail.inc.php +

+ + + + + +
+
+require("class.phpmailer.php");
+
+class my_phpmailer extends phpmailer {
+    // Set default variables for all new objects
+    var $From     = "from@example.com";
+    var $FromName = "Mailer";
+    var $Host     = "smtp1.example.com;smtp2.example.com";
+    var $Mailer   = "smtp";                         // Alternative to IsSMTP()
+    var $WordWrap = 75;
+
+    // Replace the default error_handler
+    function error_handler($msg) {
+        print("My Site Error");
+        print("Description:");
+        printf("%s", $msg);
+        exit;
+    }
+
+    // Create an additional function
+    function do_something($something) {
+        // Place your new code here
+    }
+}
+
+
+ +Now here's a normal PHP page in the site, which will have all the defaults set +above:
+Normal PHP file: mail_test.php +

+ + + + + +
+
+require("mail.inc.php");
+
+// Instantiate your new class
+$mail = new my_phpmailer;
+
+// Now you only need to add the necessary stuff
+$mail->AddAddress("josh@example.com", "Josh Adams");
+$mail->Subject = "Here is the subject";
+$mail->Body    = "This is the message body";
+$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip");  // optional name
+
+if(!$mail->Send())
+{
+   echo "There was an error sending the message";
+   exit;
+}
+
+echo "Message was sent successfully";
+
+
+

+ + + diff --git a/inc/classes/third_party/php_mailer/docs/faq.html b/inc/classes/third_party/php_mailer/docs/faq.html new file mode 100644 index 0000000..54ac183 --- /dev/null +++ b/inc/classes/third_party/php_mailer/docs/faq.html @@ -0,0 +1,67 @@ + + +PHPMailer FAQ + + + +
+
+

PHPMailer FAQ

+
    + +
  • Q: I'm using the SMTP mailer and I keep on getting a timeout message + well before the X seconds I set it for. What gives?
    + A: PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout + early. You can fix this by re-compiling PHP 4.0.4pl1 with this fix: + timeoutfix.diff. Otherwise you can wait for the new PHP release.

  • + +
  • Q: I am concerned that using include files will take up too much + processing time on my computer. How can I make it run faster?
    + A: PHP by itself is very fast. Much faster than ASP or JSP running on + the same type of server. This is because it has very little overhead compared + to its competitors and it pre-compiles all of + its code before it runs each script (in PHP4). However, all of + this compiling and re-compiling can take up a lot of valuable + computer resources. However, there are programs out there that compile + PHP code and store it in memory (or on mmaped files) to reduce the + processing immensely. Two of these: APC + (Alternative PHP Cache) and Afterburner + (Win32 download) + are excellent free tools that do just this. If you have the money + you might also try Zend Cache, it is + even faster than the open source varieties. All of these tools make your + scripts run faster while also reducing the load on your server. I have tried + them myself and they are quite stable too.

  • + +
  • Q: What mailer gives me the best performance?
    + A: On a single machine the sendmail (or Qmail) is fastest overall. + Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP. + If you have you have your mail server on a another machine then + SMTP is your only option, but you do get the benefit of redundant mail servers.
    + If you are running a mailing list with thousands of names, the fastest mailers in order are: SMTP, sendmail (or Qmail), mail().

  • + +
  • Q: When I try to attach a file with on my server I get a + "Could not find {file} on filesystem error". Why is this?
    + A: If you are using a Unix machine this is probably because the user + running your web server does not have read access to the directory in question. If you are using Windows, + then the problem probably is that you have used single backslashes to denote directories (\). + A single backslash has a special meaning to PHP so these are not + valid. Instead use double backslashes ("\\") or a single forward + slash ("/").

  • + +
+ +
+
+ + + diff --git a/inc/classes/third_party/php_mailer/docs/pop3_article.txt b/inc/classes/third_party/php_mailer/docs/pop3_article.txt new file mode 100644 index 0000000..379c44e --- /dev/null +++ b/inc/classes/third_party/php_mailer/docs/pop3_article.txt @@ -0,0 +1,39 @@ +This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented. + +With that noted, here is how to implement it: +Install the class file + +I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer-1.72 directory: +[geshi lang=php] require 'phpmailer-1.72/class.phpmailer.php'; require 'phpmailer-1.72/class.pop3.php'; [/geshi] +When you need it, create your POP3 object + +Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer: +[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi] + +The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are Connect, Logon and Disconnect methods available, but I wrapped them in the single Authorisation one to make things easier. +The Parameters + +The Authorise parameters are as follows: +[geshi lang=php]$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);[/geshi] + + 1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address) + 2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host) + 3. 30 - A connection time-out value (in seconds) + 4. mailer - The POP3 Username required to logon + 5. password - The POP3 Password required to logon + 6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser) + +Final Comments + the Download + +1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me. + +2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time. + +3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead. + +4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with. +Download + +Here is the full class file plus my test script: POP_before_SMTP_PHPMailer.zip (4 KB) - Please note that it does not include PHPMailer itself. + +My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class) diff --git a/inc/classes/third_party/php_mailer/docs/use_gmail.txt b/inc/classes/third_party/php_mailer/docs/use_gmail.txt new file mode 100644 index 0000000..3669f5d --- /dev/null +++ b/inc/classes/third_party/php_mailer/docs/use_gmail.txt @@ -0,0 +1,45 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->SMTPSecure = "ssl"; // sets the prefix to the servier +$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server +$mail->Port = 465; // set the SMTP port + +$mail->Username = "yourname@gmail.com"; // GMAIL username +$mail->Password = "password"; // GMAIL password + +$mail->From = "replyto@yourdomain.com"; +$mail->FromName = "Webmaster"; +$mail->Subject = "This is the subject"; +$mail->AltBody = "This is the body when user views in plain text format"; //Text Body +$mail->WordWrap = 50; // set word wrap + +$mail->MsgHTML($body); + +$mail->AddReplyTo("replyto@yourdomain.com","Webmaster"); + +$mail->AddAttachment("/path/to/file.zip"); // attachment +$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment + +$mail->AddAddress("username@domain.com","First Last"); + +$mail->IsHTML(true); // send as HTML + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message has been sent"; +} + +?> diff --git a/inc/classes/third_party/php_mailer/examples/contents.html b/inc/classes/third_party/php_mailer/examples/contents.html new file mode 100644 index 0000000..70c7e30 --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/contents.html @@ -0,0 +1,12 @@ + +
+

+
+ This is a test of PHPMailer v2.0.0 rc1.
+
+This particular example uses HTML, with a <div> tag and inline
+styles.
+
+Also note the use of the PHPMailer at the top with no specific code to handle +including it in the body of the email.
+ diff --git a/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif b/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif new file mode 100644 index 0000000..bc89624 Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif differ diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif b/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif new file mode 100644 index 0000000..5e26971 Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif differ diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer.png b/inc/classes/third_party/php_mailer/examples/images/phpmailer.png new file mode 100644 index 0000000..abe0101 Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer.png differ diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif b/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif new file mode 100644 index 0000000..dc7d782 Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif differ diff --git a/inc/classes/third_party/php_mailer/examples/index.html b/inc/classes/third_party/php_mailer/examples/index.html new file mode 100644 index 0000000..d0a8b9d --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/index.html @@ -0,0 +1,73 @@ +

The example file "test_mail.php" contents include:

+
+ +<?php
+
+include_once('../class.phpmailer.php');
+
+$mail = new PHPMailer();
+
+$body = $mail->getFile('contents.html');
+
+$body = eregi_replace("[\]",'',$body);
+$subject = eregi_replace("[\]",'',$subject);
+
+$mail->From = "name@yourdomain.com";
+$mail->FromName = "First Last";
+
+$mail->Subject = "PHPMailer Test Subject";
+
+$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
+
+$mail->MsgHTML($body);
+
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");
+
+if(!$mail->Send()) {
+ echo 'Failed to send mail';
+} else {
+ echo 'Mail sent';
+}
+
+?> +
+
+
+Although you could use full compabitility with PHPMailer 1.7.3, this example +shows how to use the new features. If you view 'contents.html', you will note +that there is a background image used in the <body tag as well as an image used +with a regular <img tag. Here's what the HTML file looks like:
+
+
+ +<body background="images/bkgrnd.gif" style="margin: 0px;">
+<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
+<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
+<br>
+ This is a test of PHPMailer v2.0.0 rc1.<br>
+<br>
+This particular example uses <strong>HTML</strong>, with a <div> tag and inline<br>
+styles.<br>
+<br>
+Also note the use of the PHPMailer at the top with no specific code to handle
+including it in the body of the email.</div>
+</body>
+
+
+
+A few things to notice in the PHP script that generates the email: +
    +
  • the use of $mail->AltBody is completely optional. If not used, PHPMailer + will use the HTML text with htmlentities().
  • +
  • the background= and <img src= images were processed without any directives + or methods from the PHP script
  • +
  • there is no specific code to define the image type ... that is handled + automatically by PHPMailer when it parses the images
  • +
  • we are using a new class method '$mail->MsgHTML($body)' ... that is what will handle the parsing of the images and creating the AltBody text
  • +
+

Of course, you can still use PHPMailer the same way you have in the past. +That provides full compatibility with all existing scripts, while new scripts +can take advantage of the new features.

+

Modify test_mail.php now with your own email address and try it out.

+To see what the email SHOULD look like in your HTML compatible email viewer: click here
+ diff --git a/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php b/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php new file mode 100644 index 0000000..794b2a2 --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php @@ -0,0 +1,39 @@ + + +POP before SMTP Test + + + + +
+Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
+
+  $mail = new PHPMailer();
+
+  $mail->IsSMTP();
+  $mail->SMTPDebug = 2;
+  $mail->IsHTML(false);
+
+  $mail->Host     = 'relay.example.com';
+
+  $mail->From     = 'mailer@example.com';
+  $mail->FromName = 'Example Mailer';
+
+  $mail->Subject  =  'My subject';
+  $mail->Body     =  'Hello world';
+  $mail->AddAddress('name@anydomain.com', 'First Last');
+
+  if (!$mail->Send())
+  {
+    echo $mail->ErrorInfo;
+  }
+?>
+
+ + + diff --git a/inc/classes/third_party/php_mailer/examples/test_gmail.php b/inc/classes/third_party/php_mailer/examples/test_gmail.php new file mode 100644 index 0000000..4592efc --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/test_gmail.php @@ -0,0 +1,50 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->SMTPSecure = "ssl"; // sets the prefix to the servier +$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server +$mail->Port = 465; // set the SMTP port for the GMAIL server + +$mail->Username = "yourusername@gmail.com"; // GMAIL username +$mail->Password = "yourpassword"; // GMAIL password + +$mail->AddReplyTo("yourusername@gmail.com","First Last"); + +$mail->From = "name@yourdomain.com"; +$mail->FromName = "First Last"; + +$mail->Subject = "PHPMailer Test Subject via gmail"; + +//$mail->Body = "Hi,
This is the HTML BODY
"; //HTML Body +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test +$mail->WordWrap = 50; // set word wrap + +$mail->MsgHTML($body); + +$mail->AddAddress("whoto@otherdomain.com", "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment + +$mail->IsHTML(true); // send as HTML + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> diff --git a/inc/classes/third_party/php_mailer/examples/test_mail.php b/inc/classes/third_party/php_mailer/examples/test_mail.php new file mode 100644 index 0000000..e87056e --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/test_mail.php @@ -0,0 +1,29 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->From = "name@yourdomain.com"; +$mail->FromName = "First Last"; + +$mail->Subject = "PHPMailer Test Subject via mail()"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$mail->AddAddress("whoto@otherdomain.com", "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> diff --git a/inc/classes/third_party/php_mailer/examples/test_sendmail.php b/inc/classes/third_party/php_mailer/examples/test_sendmail.php new file mode 100644 index 0000000..38eb78d --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/test_sendmail.php @@ -0,0 +1,37 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSendmail(); // telling the class to use SendMail transport + +$mail->From = "name@yourdomain.com"; +$mail->FromName = "First Last"; + +$mail->Subject = "PHPMailer Test Subject via smtp"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$mail->AddAddress("whoto@otherdomain.com", "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> diff --git a/inc/classes/third_party/php_mailer/examples/test_smtp.php b/inc/classes/third_party/php_mailer/examples/test_smtp.php new file mode 100644 index 0000000..bc46c67 --- /dev/null +++ b/inc/classes/third_party/php_mailer/examples/test_smtp.php @@ -0,0 +1,39 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); // telling the class to use SMTP +$mail->Host = "mail.worxteam.com"; // SMTP server + +$mail->From = "name@yourdomain.com"; +$mail->FromName = "First Last"; + +$mail->Subject = "PHPMailer Test Subject via smtp"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$mail->AddAddress("whoto@otherdomain.com", "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> diff --git a/inc/classes/third_party/php_mailer/language/.htaccess b/inc/classes/third_party/php_mailer/language/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/third_party/php_mailer/language/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html new file mode 100644 index 0000000..87be402 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html @@ -0,0 +1,1475 @@ + + + + + + Docs For Class PHPMailer + + + + +
+

Class PHPMailer

+ + +
+
Description
+ +
+ +

PHPMailer - PHP email transport class

+
    +
  • copyright:

    2001 - 2003 Brent R. Matzelle

  • +
  • author:

    Brent R. Matzelle

  • +
+

+ Located in Program_Root/class.phpmailer.php (line 20) +

+ + +

+	
+			
+
+ + + +
+
Variable Summary
+ +
+
+
+ string + $AltBody +
+
+ string + $Body +
+
+ string + $CharSet +
+
+ string + $ConfirmReadingTo +
+
+ string + $ContentType +
+
+ string + $Encoding +
+
+ string + $ErrorInfo +
+
+ string + $From +
+
+ string + $FromName +
+
+ string + $Helo +
+
+ string + $Host +
+
+ string + $Hostname +
+
+ string + $Mailer +
+
+ string + $Password +
+
+ string + $PluginDir +
+
+ int + $Port +
+
+ int + $Priority +
+
+ string + $Sender +
+
+ string + $Sendmail +
+
+ bool + $SMTPAuth +
+
+ bool + $SMTPDebug +
+
+ bool + $SMTPKeepAlive +
+
+ string + $Subject +
+
+ int + $Timeout +
+
+ string + $Username +
+
+ string + $Version +
+
+ int + $WordWrap +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + AddAddress + (string $address, [string $name = ""]) +
+ +
+ bool + AddAttachment + (string $path, [string $name = ""], [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
+ void + AddBCC + (string $address, [string $name = ""]) +
+ +
+ void + AddCC + (string $address, [string $name = ""]) +
+ +
+ void + AddCustomHeader + (mixed $custom_header) +
+ +
+ bool + AddEmbeddedImage + (string $path, string $cid, [string $name = ""], [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
+ void + AddReplyTo + (string $address, [string $name = ""]) +
+ +
+ void + AddStringAttachment + (string $string, string $filename, [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
+ void + ClearAddresses + () +
+ +
+ void + ClearAllRecipients + () +
+ +
+ void + ClearAttachments + () +
+ +
+ void + ClearBCCs + () +
+ +
+ void + ClearCCs + () +
+ +
+ void + ClearCustomHeaders + () +
+ +
+ void + ClearReplyTos + () +
+ +
+ bool + IsError + () +
+ +
+ void + IsHTML + (bool $bool) +
+ +
+ void + IsMail + () +
+ +
+ void + IsQmail + () +
+ +
+ void + IsSendmail + () +
+ +
+ void + IsSMTP + () +
+ +
+ bool + Send + () +
+ +
+ bool + SetLanguage + (string $lang_type, [string $lang_path = ""]) +
+ +
+ void + SmtpClose + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + string + $AltBody + = "" (line 96) + +
+ + +

Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.

+ + + + + +
+ +
+ +
+ + string + $Body + = "" (line 87) + +
+ + +

Sets the Body of the message. This can be either an HTML or text body.

+

If HTML then run IsHTML(true).

+ + + + + +
+ +
+ +
+ + string + $CharSet + = "iso-8859-1" (line 36) + +
+ + +

Sets the CharSet of the message.

+ + + + + +
+ +
+ +
+ + string + $ConfirmReadingTo + = "" (line 134) + +
+ + +

Sets the email address that a reading confirmation will be sent.

+ + + + + +
+ +
+ +
+ + string + $ContentType + = "text/plain" (line 42) + +
+ + +

Sets the Content-type of the message.

+ + + + + +
+ +
+ +
+ + string + $Encoding + = "8bit" (line 49) + +
+ + +

Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".

+ + + + + +
+ +
+ +
+ + string + $ErrorInfo + = "" (line 55) + +
+ + +

Holds the most recent mailer error message.

+ + + + + +
+ +
+ +
+ + string + $From + = "root@localhost" (line 61) + +
+ + +

Sets the From email address for the message.

+ + + + + +
+ +
+ +
+ + string + $FromName + = "Root User" (line 67) + +
+ + +

Sets the From name of the message.

+ + + + + +
+ +
+ +
+ + string + $Helo + = "" (line 169) + +
+ + +

Sets the SMTP HELO of the message (Default is $Hostname).

+ + + + + +
+ +
+ +
+ + string + $Host + = "localhost" (line 157) + +
+ + +

Sets the SMTP hosts. All hosts must be separated by a semicolon. You can also specify a different port for each host by using this format: [hostname:port] (e.g. "smtp1.example.com:25;smtp2.example.com").

+

Hosts will be tried in order.

+ + + + + +
+ +
+ +
+ + string + $Hostname + = "" (line 142) + +
+ + +

Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.

+ + + + + +
+ +
+ +
+ + string + $Mailer + = "mail" (line 109) + +
+ + +

Method to send mail: ("mail", "sendmail", or "smtp").

+ + + + + +
+ +
+ +
+ + string + $Password + = "" (line 187) + +
+ + +

Sets SMTP password.

+ + + + + +
+ +
+ +
+ + string + $PluginDir + = "" (line 122) + +
+ + +

Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.

+ + + + + +
+ +
+ +
+ + int + $Port + = 25 (line 163) + +
+ + +

Sets the default SMTP server port.

+ + + + + +
+ +
+ +
+ + int + $Priority + = 3 (line 30) + +
+ + +

Email priority (1 = High, 3 = Normal, 5 = low).

+ + + + + +
+ +
+ +
+ + string + $Sender + = "" (line 74) + +
+ + +

Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

+ + + + + +
+ +
+ +
+ + string + $Sendmail + = "/usr/sbin/sendmail" (line 115) + +
+ + +

Sets the path of the sendmail program.

+ + + + + +
+ +
+ +
+ + bool + $SMTPAuth + = false (line 175) + +
+ + +

Sets SMTP authentication. Utilizes the Username and Password variables.

+ + + + + +
+ +
+ +
+ + bool + $SMTPDebug + = false (line 200) + +
+ + +

Sets SMTP class debugging on or off.

+ + + + + +
+ +
+ +
+ + bool + $SMTPKeepAlive + = false (line 208) + +
+ + +

Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().

+ + + + + +
+ +
+ +
+ + string + $Subject + = "" (line 80) + +
+ + +

Sets the Subject of the message.

+ + + + + +
+ +
+ +
+ + int + $Timeout + = 10 (line 194) + +
+ + +

Sets the SMTP server timeout in seconds. This function will not work with the win32 version.

+ + + + + +
+ +
+ +
+ + string + $Username + = "" (line 181) + +
+ + +

Sets SMTP username.

+ + + + + +
+ +
+ +
+ + string + $Version + = "1.71" (line 128) + +
+ + +

Holds PHPMailer version.

+ + + + + +
+ +
+ +
+ + int + $WordWrap + = 0 (line 103) + +
+ + +

Sets word wrapping on the body of the message to a given number of characters.

+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + +
+ +
+ AddAddress (line 287) +
+ + +

Adds a "To" address.

+ +
+ void + + AddAddress + + (string $address, [string $name = ""]) +
+ +
    +
  • + string + $address
  • +
  • + string + $name
  • +
+ + +
+ +
+ +
+ AddAttachment (line 1000) +
+ + +

Adds an attachment from a path on the filesystem.

+

Returns false if the file could not be found or accessed.

+ +
+ bool + + AddAttachment + + (string $path, [string $name = ""], [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
    +
  • + string + $path:

    Path to the attachment.

  • +
  • + string + $name:

    Overrides the attachment name.

  • +
  • + string + $encoding:

    File encoding (see $Encoding).

  • +
  • + string + $type:

    File extension (MIME) type.

  • +
+ + +
+ +
+ +
+ AddBCC (line 315) +
+ + +

Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

+ +
+ void + + AddBCC + + (string $address, [string $name = ""]) +
+ +
    +
  • + string + $address
  • +
  • + string + $name
  • +
+ + +
+ +
+ +
+ AddCC (line 301) +
+ + +

Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

+ +
+ void + + AddCC + + (string $address, [string $name = ""]) +
+ +
    +
  • + string + $address
  • +
  • + string + $name
  • +
+ + +
+ +
+ +
+ AddCustomHeader (line 1525) +
+ + +

Adds a custom header.

+ +
+ void + + AddCustomHeader + + (mixed $custom_header) +
+ + + +
+ +
+ +
+ AddEmbeddedImage (line 1275) +
+ + +

Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".

+ +
+ bool + + AddEmbeddedImage + + (string $path, string $cid, [string $name = ""], [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
    +
  • + string + $path:

    Path to the attachment.

  • +
  • + string + $cid:

    Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.

  • +
  • + string + $name:

    Overrides the attachment name.

  • +
  • + string + $encoding:

    File encoding (see $Encoding).

  • +
  • + string + $type:

    File extension (MIME) type.

  • +
+ + +
+ +
+ +
+ AddReplyTo (line 327) +
+ + +

Adds a "Reply-to" address.

+ +
+ void + + AddReplyTo + + (string $address, [string $name = ""]) +
+ +
    +
  • + string + $address
  • +
  • + string + $name
  • +
+ + +
+ +
+ +
+ AddStringAttachment (line 1248) +
+ + +

Adds a string or binary attachment (non-filesystem) to the list.

+

This method can be used to attach ascii or binary data, such as a BLOB record from a database.

+ +
+ void + + AddStringAttachment + + (string $string, string $filename, [string $encoding = "base64"], [string $type = "application/octet-stream"]) +
+ +
    +
  • + string + $string:

    String attachment data.

  • +
  • + string + $filename:

    Name of the attachment.

  • +
  • + string + $encoding:

    File encoding (see $Encoding).

  • +
  • + string + $type:

    File extension (MIME) type.

  • +
+ + +
+ +
+ +
+ ClearAddresses (line 1329) +
+ + +

Clears all recipients assigned in the TO array. Returns void.

+ +
+ void + + ClearAddresses + + () +
+ + + +
+ +
+ +
+ ClearAllRecipients (line 1362) +
+ + +

Clears all recipients assigned in the TO, CC and BCC array. Returns void.

+ +
+ void + + ClearAllRecipients + + () +
+ + + +
+ +
+ +
+ ClearAttachments (line 1373) +
+ + +

Clears all previously set filesystem, string, and binary attachments. Returns void.

+ +
+ void + + ClearAttachments + + () +
+ + + +
+ +
+ +
+ ClearBCCs (line 1345) +
+ + +

Clears all recipients assigned in the BCC array. Returns void.

+ +
+ void + + ClearBCCs + + () +
+ + + +
+ +
+ +
+ ClearCCs (line 1337) +
+ + +

Clears all recipients assigned in the CC array. Returns void.

+ +
+ void + + ClearCCs + + () +
+ + + +
+ +
+ +
+ ClearCustomHeaders (line 1381) +
+ + +

Clears all custom headers. Returns void.

+ +
+ void + + ClearCustomHeaders + + () +
+ + + +
+ +
+ +
+ ClearReplyTos (line 1353) +
+ + +

Clears all recipients assigned in the ReplyTo array. Returns void.

+ +
+ void + + ClearReplyTos + + () +
+ + + +
+ +
+ +
+ IsError (line 1505) +
+ + +

Returns true if an error occurred.

+ +
+ bool + + IsError + + () +
+ + + +
+ +
+ +
+ IsHTML (line 236) +
+ + +

Sets message type to HTML.

+ +
+ void + + IsHTML + + (bool $bool) +
+ +
    +
  • + bool + $bool
  • +
+ + +
+ +
+ +
+ IsMail (line 255) +
+ + +

Sets Mailer to send message using PHP mail() function.

+ +
+ void + + IsMail + + () +
+ + + +
+ +
+ +
+ IsQmail (line 271) +
+ + +

Sets Mailer to send message using the qmail MTA.

+ +
+ void + + IsQmail + + () +
+ + + +
+ +
+ +
+ IsSendmail (line 263) +
+ + +

Sets Mailer to send message using the $Sendmail program.

+ +
+ void + + IsSendmail + + () +
+ + + +
+ +
+ +
+ IsSMTP (line 247) +
+ + +

Sets Mailer to send message using SMTP.

+ +
+ void + + IsSMTP + + () +
+ + + +
+ +
+ +
+ Send (line 344) +
+ + +

Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.

+ +
+ bool + + Send + + () +
+ + + +
+ +
+ +
+ SetLanguage (line 599) +
+ + +

Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.

+
    +
  • access: public
  • +
+ +
+ bool + + SetLanguage + + (string $lang_type, [string $lang_path = ""]) +
+ +
    +
  • + string + $lang_type:

    Type of language (e.g. Portuguese: "br")

  • +
  • + string + $lang_path:

    Path to the language file directory

  • +
+ + +
+ +
+ +
+ SmtpClose (line 579) +
+ + +

Closes the active SMTP session if one exists.

+ +
+ void + + SmtpClose + + () +
+ + + +
+ +
+
+ +

+ Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by phpDocumentor 1.2.0 +

+
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html new file mode 100644 index 0000000..4fdecb1 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html @@ -0,0 +1,734 @@ + + + + + + Docs For Class SMTP + + + + +
+

Class SMTP

+ + +
+
Description
+ +
+ +

SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except TURN which will always return a not implemented error. SMTP also provides some utility methods for sending mail to an SMTP server.

+
    +
  • author:

    Chris Ryan

  • +
+

+ Located in Program_Root/class.smtp.php (line 24) +

+ + +

+	
+			
+
+ + + +
+
Variable Summary
+ +
+
+
+ string + $CRLF +
+
+ bool + $do_debug +
+
+ int + $SMTP_PORT +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + SMTP + () +
+ +
+ bool + Authenticate + (mixed $username, mixed $password) +
+ +
+ void + Close + () +
+ +
+ bool + Connect + (mixed $host, mixed $port, [mixed $tval = 30]) +
+ +
+ bool + Data + (mixed $msg_data) +
+ +
+ string + Expand + (mixed $name) +
+ +
+ bool + Hello + ([mixed $host = ""]) +
+ +
+ string + Help + ([mixed $keyword = ""]) +
+ +
+ bool + Mail + (mixed $from) +
+ +
+ bool + Noop + () +
+ +
+ bool + Quit + ([mixed $close_on_error = true]) +
+ +
+ bool + Recipient + (mixed $to) +
+ +
+ bool + Reset + () +
+ +
+ bool + Send + (mixed $from) +
+ +
+ bool + SendAndMail + (mixed $from) +
+ +
+ bool + SendOrMail + (mixed $from) +
+ +
+ bool + Turn + () +
+ +
+ int + Verify + (mixed $name) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + string + $CRLF + = "\r\n" (line 36) + +
+ + +

SMTP reply line ending

+ + + + + +
+ +
+ +
+ + bool + $do_debug + (line 42) + +
+ + +

Sets whether debugging is turned on

+ + + + + +
+ +
+ +
+ + int + $SMTP_PORT + = 25 (line 30) + +
+ + +

SMTP server port

+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + +
+ +
+ Constructor SMTP (line 57) +
+ + +

Initialize the class so that the data is in a known state.

+
    +
  • access: public
  • +
+ +
+ void + + SMTP + + () +
+ + + +
+ +
+ +
+ Authenticate (line 144) +
+ + +

Performs SMTP authentication. Must be run after running the Hello() method. Returns true if successfully authenticated.

+
    +
  • access: public
  • +
+ +
+ bool + + Authenticate + + (mixed $username, mixed $password) +
+ + + +
+ +
+ +
+ Close (line 232) +
+ + +

Closes the socket and cleans up the state of the class.

+

It is not considered good to use this function without first trying to use QUIT.

+
    +
  • access: public
  • +
+ +
+ void + + Close + + () +
+ + + +
+ +
+ +
+ Connect (line 82) +
+ + +

Connect to the server specified on the port specified.

+

If the port is not specified use the default SMTP_PORT. If tval is specified then a connection will try and be established with the server for that number of seconds. If tval is not specified the default is 30 seconds to try on the connection.

SMTP CODE SUCCESS: 220 SMTP CODE FAILURE: 421

+
    +
  • access: public
  • +
+ +
+ bool + + Connect + + (mixed $host, mixed $port, [mixed $tval = 30]) +
+ + + +
+ +
+ +
+ Data (line 266) +
+ + +

Issues a data command and sends the msg_data to the server

+

finializing the mail transaction. $msg_data is the message that is to be send with the headers. Each header needs to be on a single line followed by a <CRLF> with the message headers and the message body being seperated by and additional <CRLF>.

Implements rfc 821: DATA <CRLF>

SMTP CODE INTERMEDIATE: 354 [data] <CRLF>.<CRLF> SMTP CODE SUCCESS: 250 SMTP CODE FAILURE: 552,554,451,452 SMTP CODE FAILURE: 451,554 SMTP CODE ERROR : 500,501,503,421

+
    +
  • access: public
  • +
+ +
+ bool + + Data + + (mixed $msg_data) +
+ + + +
+ +
+ +
+ Expand (line 399) +
+ + +

Expand takes the name and asks the server to list all the people who are members of the _list_. Expand will return back and array of the result or false if an error occurs.

+

Each value in the array returned has the format of: [ <full-name> <sp> ] <path> The definition of <path> is defined in rfc 821

Implements rfc 821: EXPN <SP> <string> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE FAILURE: 550 SMTP CODE ERROR : 500,501,502,504,421

+
    +
  • return:

    array

  • +
  • access: public
  • +
+ +
+ string + + Expand + + (mixed $name) +
+ + + +
+ +
+ +
+ Hello (line 450) +
+ + +

Sends the HELO command to the smtp server.

+

This makes sure that we and the server are in the same known state.

Implements from rfc 821: HELO <SP> <domain> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE ERROR : 500, 501, 504, 421

+
    +
  • access: public
  • +
+ +
+ bool + + Hello + + ([mixed $host = ""]) +
+ + + +
+ +
+ +
+ Help (line 524) +
+ + +

Gets help information on the keyword specified. If the keyword

+

is not specified then returns generic help, ussually contianing A list of keywords that help is available on. This function returns the results back to the user. It is up to the user to handle the returned data. If an error occurs then false is returned with $this->error set appropiately.

Implements rfc 821: HELP [ <SP> <string> ] <CRLF>

SMTP CODE SUCCESS: 211,214 SMTP CODE ERROR : 500,501,502,504,421

+
    +
  • access: public
  • +
+ +
+ string + + Help + + ([mixed $keyword = ""]) +
+ + + +
+ +
+ +
+ Mail (line 576) +
+ + +

Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command.

+

Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS: 500,501,421

+
    +
  • access: public
  • +
+ +
+ bool + + Mail + + (mixed $from) +
+ + + +
+ +
+ +
+ Noop (line 618) +
+ + +

Sends the command NOOP to the SMTP server.

+

Implements from rfc 821: NOOP <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE ERROR : 500, 421

+
    +
  • access: public
  • +
+ +
+ bool + + Noop + + () +
+ + + +
+ +
+ +
+ Quit (line 661) +
+ + +

Sends the quit command to the server and then closes the socket if there is no error or the $close_on_error argument is true.

+

Implements from rfc 821: QUIT <CRLF>

SMTP CODE SUCCESS: 221 SMTP CODE ERROR : 500

+
    +
  • access: public
  • +
+ +
+ bool + + Quit + + ([mixed $close_on_error = true]) +
+ + + +
+ +
+ +
+ Recipient (line 715) +
+ + +

Sends the command RCPT to the SMTP server with the TO: argument of $to.

+

Returns true if the recipient was accepted false if it was rejected.

Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>

SMTP CODE SUCCESS: 250,251 SMTP CODE FAILURE: 550,551,552,553,450,451,452 SMTP CODE ERROR : 500,501,503,421

+
    +
  • access: public
  • +
+ +
+ bool + + Recipient + + (mixed $to) +
+ + + +
+ +
+ +
+ Reset (line 759) +
+ + +

Sends the RSET command to abort and transaction that is currently in progress. Returns true if successful false otherwise.

+

Implements rfc 821: RSET <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE ERROR : 500,501,504,421

+
    +
  • access: public
  • +
+ +
+ bool + + Reset + + () +
+ + + +
+ +
+ +
+ Send (line 808) +
+ + +

Starts a mail transaction from the email address specified in

+

$from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command. This command will send the message to the users terminal if they are logged in.

Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS: 500,501,502,421

+
    +
  • access: public
  • +
+ +
+ bool + + Send + + (mixed $from) +
+ + + +
+ +
+ +
+ SendAndMail (line 856) +
+ + +

Starts a mail transaction from the email address specified in

+

$from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command. This command will send the message to the users terminal if they are logged in and send them an email.

Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS: 500,501,502,421

+
    +
  • access: public
  • +
+ +
+ bool + + SendAndMail + + (mixed $from) +
+ + + +
+ +
+ +
+ SendOrMail (line 904) +
+ + +

Starts a mail transaction from the email address specified in

+

$from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command. This command will send the message to the users terminal if they are logged in or mail it to them if they are not.

Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS: 500,501,502,421

+
    +
  • access: public
  • +
+ +
+ bool + + SendOrMail + + (mixed $from) +
+ + + +
+ +
+ +
+ Turn (line 949) +
+ + +

This is an optional command for SMTP that this class does not support. This method is here to make the RFC821 Definition complete for this class and __may__ be implimented in the future

+

Implements from rfc 821: TURN <CRLF>

SMTP CODE SUCCESS: 250 SMTP CODE FAILURE: 502 SMTP CODE ERROR : 500, 503

+
    +
  • access: public
  • +
+ +
+ bool + + Turn + + () +
+ + + +
+ +
+ +
+ Verify (line 971) +
+ + +

Verifies that the name is recognized by the server.

+

Returns false if the name could not be verified otherwise the response from the server is returned.

Implements rfc 821: VRFY <SP> <string> <CRLF>

SMTP CODE SUCCESS: 250,251 SMTP CODE FAILURE: 550,551,553 SMTP CODE ERROR : 500,501,502,421

+
    +
  • access: public
  • +
+ +
+ int + + Verify + + (mixed $name) +
+ + + +
+ +
+
+ +

+ Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by phpDocumentor 1.2.0 +

+
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html new file mode 100644 index 0000000..f7bde2c --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page class.phpmailer.php + + + + +
+

Program_Root/class.phpmailer.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ PHPMailer + + PHPMailer - PHP email transport class +
+
+
+ + + + + +

+ Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by phpDocumentor 1.2.0 +

+
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html new file mode 100644 index 0000000..1b7d1b5 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page class.smtp.php + + + + +
+

Program_Root/class.smtp.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ SMTP + + SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except TURN which will always return a not implemented error. SMTP also provides some utility methods for sending mail to an SMTP server. +
+
+
+ + + + + +

+ Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by phpDocumentor 1.2.0 +

+
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/blank.html b/inc/classes/third_party/php_mailer/phpdoc/blank.html new file mode 100644 index 0000000..4382bc9 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/blank.html @@ -0,0 +1,13 @@ + + + Generated Documentation + + + + +

Generated Documentation

+Welcome to default!
+
+This documentation was generated by phpDocumentor v1.2.0
+ + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html new file mode 100644 index 0000000..f8a48da --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + +

+ +

+

Root class PHPMailer

+ + +

Root class SMTP

+ + +

+ Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by phpDocumentor 1.2.0 +

+ + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/elementindex.html b/inc/classes/third_party/php_mailer/phpdoc/elementindex.html new file mode 100644 index 0000000..7f65a76 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/elementindex.html @@ -0,0 +1,734 @@ + + + + + + + + + + + +

Full index

+

Package indexes

+ +
+
+ a + b + c + d + e + f + h + i + m + n + p + q + r + s + t + u + v + w +
+ + +
+
a
+ +
+
+
+
+ $AltBody +
+
+
PHPMailer::$AltBody in class.phpmailer.php
+
Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.
+
+
+ AddAddress +
+
+
PHPMailer::AddAddress() in class.phpmailer.php
+
Adds a "To" address.
+
+
+ AddAttachment +
+
+
PHPMailer::AddAttachment() in class.phpmailer.php
+
Adds an attachment from a path on the filesystem.
+
+
+ AddBCC +
+
+
PHPMailer::AddBCC() in class.phpmailer.php
+
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+
+
+ AddCC +
+
+
PHPMailer::AddCC() in class.phpmailer.php
+
Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+
+
+ AddCustomHeader +
+
+
PHPMailer::AddCustomHeader() in class.phpmailer.php
+
Adds a custom header.
+
+
+ AddEmbeddedImage +
+
+
PHPMailer::AddEmbeddedImage() in class.phpmailer.php
+
Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
+
+
+ AddReplyTo +
+
+
PHPMailer::AddReplyTo() in class.phpmailer.php
+
Adds a "Reply-to" address.
+
+
+ AddStringAttachment +
+
+
PHPMailer::AddStringAttachment() in class.phpmailer.php
+
Adds a string or binary attachment (non-filesystem) to the list.
+
+
+ Authenticate +
+
+
SMTP::Authenticate() in class.smtp.php
+
Performs SMTP authentication. Must be run after running the Hello() method. Returns true if successfully authenticated.
+
+
+ +
+
b
+ +
+
+
+
+ $Body +
+
+
PHPMailer::$Body in class.phpmailer.php
+
Sets the Body of the message. This can be either an HTML or text body.
+
+
+ +
+
c
+ +
+
+
+
+ $CharSet +
+
+
PHPMailer::$CharSet in class.phpmailer.php
+
Sets the CharSet of the message.
+
+
+ $ConfirmReadingTo +
+
+
PHPMailer::$ConfirmReadingTo in class.phpmailer.php
+
Sets the email address that a reading confirmation will be sent.
+
+
+ $ContentType +
+
+
PHPMailer::$ContentType in class.phpmailer.php
+
Sets the Content-type of the message.
+
+
+ $CRLF +
+
+
SMTP::$CRLF in class.smtp.php
+
SMTP reply line ending
+
+
+ class.phpmailer.php +
+
+
class.phpmailer.php in class.phpmailer.php
+
+
+ class.smtp.php +
+
+
class.smtp.php in class.smtp.php
+
+
+ ClearAddresses +
+
+
PHPMailer::ClearAddresses() in class.phpmailer.php
+
Clears all recipients assigned in the TO array. Returns void.
+
+
+ ClearAllRecipients +
+
+
PHPMailer::ClearAllRecipients() in class.phpmailer.php
+
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
+
+
+ ClearAttachments +
+
+
PHPMailer::ClearAttachments() in class.phpmailer.php
+
Clears all previously set filesystem, string, and binary attachments. Returns void.
+
+
+ ClearBCCs +
+
+
PHPMailer::ClearBCCs() in class.phpmailer.php
+
Clears all recipients assigned in the BCC array. Returns void.
+
+
+ ClearCCs +
+
+
PHPMailer::ClearCCs() in class.phpmailer.php
+
Clears all recipients assigned in the CC array. Returns void.
+
+
+ ClearCustomHeaders +
+
+
PHPMailer::ClearCustomHeaders() in class.phpmailer.php
+
Clears all custom headers. Returns void.
+
+
+ ClearReplyTos +
+
+
PHPMailer::ClearReplyTos() in class.phpmailer.php
+
Clears all recipients assigned in the ReplyTo array. Returns void.
+
+
+ Close +
+
+
SMTP::Close() in class.smtp.php
+
Closes the socket and cleans up the state of the class.
+
+
+ Connect +
+
+
SMTP::Connect() in class.smtp.php
+
Connect to the server specified on the port specified.
+
+
+ +
+
d
+ +
+
+
+
+ $do_debug +
+
+
SMTP::$do_debug in class.smtp.php
+
Sets whether debugging is turned on
+
+
+ Data +
+
+
SMTP::Data() in class.smtp.php
+
Issues a data command and sends the msg_data to the server
+
+
+ +
+
e
+ +
+
+
+
+ $Encoding +
+
+
PHPMailer::$Encoding in class.phpmailer.php
+
Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
+
+
+ $ErrorInfo +
+
+
PHPMailer::$ErrorInfo in class.phpmailer.php
+
Holds the most recent mailer error message.
+
+
+ Expand +
+
+
SMTP::Expand() in class.smtp.php
+
Expand takes the name and asks the server to list all the people who are members of the _list_. Expand will return back and array of the result or false if an error occurs.
+
+
+ +
+
f
+ +
+
+
+
+ $From +
+
+
PHPMailer::$From in class.phpmailer.php
+
Sets the From email address for the message.
+
+
+ $FromName +
+
+
PHPMailer::$FromName in class.phpmailer.php
+
Sets the From name of the message.
+
+
+ +
+
h
+ +
+
+
+
+ $Helo +
+
+
PHPMailer::$Helo in class.phpmailer.php
+
Sets the SMTP HELO of the message (Default is $Hostname).
+
+
+ $Host +
+
+
PHPMailer::$Host in class.phpmailer.php
+
Sets the SMTP hosts. All hosts must be separated by a semicolon. You can also specify a different port for each host by using this format: [hostname:port] (e.g. "smtp1.example.com:25;smtp2.example.com").
+
+
+ $Hostname +
+
+
PHPMailer::$Hostname in class.phpmailer.php
+
Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.
+
+
+ Hello +
+
+
SMTP::Hello() in class.smtp.php
+
Sends the HELO command to the smtp server.
+
+
+ Help +
+
+
SMTP::Help() in class.smtp.php
+
Gets help information on the keyword specified. If the keyword
+
+
+ +
+
i
+ +
+
+
+
+ IsError +
+
+
PHPMailer::IsError() in class.phpmailer.php
+
Returns true if an error occurred.
+
+
+ IsHTML +
+
+
PHPMailer::IsHTML() in class.phpmailer.php
+
Sets message type to HTML.
+
+
+ IsMail +
+
+
PHPMailer::IsMail() in class.phpmailer.php
+
Sets Mailer to send message using PHP mail() function.
+
+
+ IsQmail +
+
+
PHPMailer::IsQmail() in class.phpmailer.php
+
Sets Mailer to send message using the qmail MTA.
+
+
+ IsSendmail +
+
+
PHPMailer::IsSendmail() in class.phpmailer.php
+
Sets Mailer to send message using the $Sendmail program.
+
+
+ IsSMTP +
+
+
PHPMailer::IsSMTP() in class.phpmailer.php
+
Sets Mailer to send message using SMTP.
+
+
+ +
+
m
+ +
+
+
+
+ $Mailer +
+
+
PHPMailer::$Mailer in class.phpmailer.php
+
Method to send mail: ("mail", "sendmail", or "smtp").
+
+
+ Mail +
+
+
SMTP::Mail() in class.smtp.php
+
Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command.
+
+
+ +
+
n
+ +
+
+
+
+ Noop +
+
+
SMTP::Noop() in class.smtp.php
+
Sends the command NOOP to the SMTP server.
+
+
+ +
+
p
+ +
+
+
+
+ $Password +
+
+
PHPMailer::$Password in class.phpmailer.php
+
Sets SMTP password.
+
+
+ $PluginDir +
+
+
PHPMailer::$PluginDir in class.phpmailer.php
+
Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.
+
+
+ $Port +
+
+
PHPMailer::$Port in class.phpmailer.php
+
Sets the default SMTP server port.
+
+
+ $Priority +
+
+
PHPMailer::$Priority in class.phpmailer.php
+
Email priority (1 = High, 3 = Normal, 5 = low).
+
+
+ PHPMailer +
+
+
PHPMailer in class.phpmailer.php
+
PHPMailer - PHP email transport class
+
+
+ +
+
q
+ +
+
+
+
+ Quit +
+
+
SMTP::Quit() in class.smtp.php
+
Sends the quit command to the server and then closes the socket if there is no error or the $close_on_error argument is true.
+
+
+ +
+
r
+ +
+
+
+
+ Recipient +
+
+
SMTP::Recipient() in class.smtp.php
+
Sends the command RCPT to the SMTP server with the TO: argument of $to.
+
+
+ Reset +
+
+
SMTP::Reset() in class.smtp.php
+
Sends the RSET command to abort and transaction that is currently in progress. Returns true if successful false otherwise.
+
+
+ +
+
s
+ +
+
+
+
+ $Sender +
+
+
PHPMailer::$Sender in class.phpmailer.php
+
Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+
+
+ $Sendmail +
+
+
PHPMailer::$Sendmail in class.phpmailer.php
+
Sets the path of the sendmail program.
+
+
+ $SMTPAuth +
+
+
PHPMailer::$SMTPAuth in class.phpmailer.php
+
Sets SMTP authentication. Utilizes the Username and Password variables.
+
+
+ $SMTPDebug +
+
+
PHPMailer::$SMTPDebug in class.phpmailer.php
+
Sets SMTP class debugging on or off.
+
+
+ $SMTPKeepAlive +
+
+
PHPMailer::$SMTPKeepAlive in class.phpmailer.php
+
Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
+
+
+ $SMTP_PORT +
+
+
SMTP::$SMTP_PORT in class.smtp.php
+
SMTP server port
+
+
+ $Subject +
+
+
PHPMailer::$Subject in class.phpmailer.php
+
Sets the Subject of the message.
+
+
+ Send +
+
+
SMTP::Send() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ Send +
+
+
PHPMailer::Send() in class.phpmailer.php
+
Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
+
+
+ SendAndMail +
+
+
SMTP::SendAndMail() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ SendOrMail +
+
+
SMTP::SendOrMail() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ SetLanguage +
+
+
PHPMailer::SetLanguage() in class.phpmailer.php
+
Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.
+
+
+ SMTP +
+
+
SMTP::SMTP() in class.smtp.php
+
Initialize the class so that the data is in a known state.
+
+
+ SMTP +
+
+
SMTP in class.smtp.php
+
SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except TURN which will always return a not implemented error. SMTP also provides some utility methods for sending mail to an SMTP server.
+
+
+ SmtpClose +
+
+
PHPMailer::SmtpClose() in class.phpmailer.php
+
Closes the active SMTP session if one exists.
+
+
+ +
+
t
+ +
+
+
+
+ $Timeout +
+
+
PHPMailer::$Timeout in class.phpmailer.php
+
Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
+
+
+ Turn +
+
+
SMTP::Turn() in class.smtp.php
+
This is an optional command for SMTP that this class does not support. This method is here to make the RFC821 Definition complete for this class and __may__ be implimented in the future
+
+
+ +
+
u
+ +
+
+
+
+ $Username +
+
+
PHPMailer::$Username in class.phpmailer.php
+
Sets SMTP username.
+
+
+ +
+
v
+ +
+
+
+
+ $Version +
+
+
PHPMailer::$Version in class.phpmailer.php
+
Holds PHPMailer version.
+
+
+ Verify +
+
+
SMTP::Verify() in class.smtp.php
+
Verifies that the name is recognized by the server.
+
+
+ +
+
w
+ +
+
+
+
+ $WordWrap +
+
+
PHPMailer::$WordWrap in class.phpmailer.php
+
Sets word wrapping on the body of the message to a given number of characters.
+
+
+ +
+ a + b + c + d + e + f + h + i + m + n + p + q + r + s + t + u + v + w +
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html new file mode 100644 index 0000000..e62d5ed --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html @@ -0,0 +1,731 @@ + + + + + + + + + + + +

[PHPMailer] element index

+All elements +
+
+ a + b + c + d + e + f + h + i + m + n + p + q + r + s + t + u + v + w +
+ + +
+
a
+ +
+
+
+
+ $AltBody +
+
+
PHPMailer::$AltBody in class.phpmailer.php
+
Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body.
+
+
+ AddAddress +
+
+
PHPMailer::AddAddress() in class.phpmailer.php
+
Adds a "To" address.
+
+
+ AddAttachment +
+
+
PHPMailer::AddAttachment() in class.phpmailer.php
+
Adds an attachment from a path on the filesystem.
+
+
+ AddBCC +
+
+
PHPMailer::AddBCC() in class.phpmailer.php
+
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+
+
+ AddCC +
+
+
PHPMailer::AddCC() in class.phpmailer.php
+
Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+
+
+ AddCustomHeader +
+
+
PHPMailer::AddCustomHeader() in class.phpmailer.php
+
Adds a custom header.
+
+
+ AddEmbeddedImage +
+
+
PHPMailer::AddEmbeddedImage() in class.phpmailer.php
+
Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
+
+
+ AddReplyTo +
+
+
PHPMailer::AddReplyTo() in class.phpmailer.php
+
Adds a "Reply-to" address.
+
+
+ AddStringAttachment +
+
+
PHPMailer::AddStringAttachment() in class.phpmailer.php
+
Adds a string or binary attachment (non-filesystem) to the list.
+
+
+ Authenticate +
+
+
SMTP::Authenticate() in class.smtp.php
+
Performs SMTP authentication. Must be run after running the Hello() method. Returns true if successfully authenticated.
+
+
+ +
+
b
+ +
+
+
+
+ $Body +
+
+
PHPMailer::$Body in class.phpmailer.php
+
Sets the Body of the message. This can be either an HTML or text body.
+
+
+ +
+
c
+ +
+
+
+
+ $CharSet +
+
+
PHPMailer::$CharSet in class.phpmailer.php
+
Sets the CharSet of the message.
+
+
+ $ConfirmReadingTo +
+
+
PHPMailer::$ConfirmReadingTo in class.phpmailer.php
+
Sets the email address that a reading confirmation will be sent.
+
+
+ $ContentType +
+
+
PHPMailer::$ContentType in class.phpmailer.php
+
Sets the Content-type of the message.
+
+
+ $CRLF +
+
+
SMTP::$CRLF in class.smtp.php
+
SMTP reply line ending
+
+
+ class.phpmailer.php +
+
+
class.phpmailer.php in class.phpmailer.php
+
+
+ class.smtp.php +
+
+
class.smtp.php in class.smtp.php
+
+
+ ClearAddresses +
+
+
PHPMailer::ClearAddresses() in class.phpmailer.php
+
Clears all recipients assigned in the TO array. Returns void.
+
+
+ ClearAllRecipients +
+
+
PHPMailer::ClearAllRecipients() in class.phpmailer.php
+
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
+
+
+ ClearAttachments +
+
+
PHPMailer::ClearAttachments() in class.phpmailer.php
+
Clears all previously set filesystem, string, and binary attachments. Returns void.
+
+
+ ClearBCCs +
+
+
PHPMailer::ClearBCCs() in class.phpmailer.php
+
Clears all recipients assigned in the BCC array. Returns void.
+
+
+ ClearCCs +
+
+
PHPMailer::ClearCCs() in class.phpmailer.php
+
Clears all recipients assigned in the CC array. Returns void.
+
+
+ ClearCustomHeaders +
+
+
PHPMailer::ClearCustomHeaders() in class.phpmailer.php
+
Clears all custom headers. Returns void.
+
+
+ ClearReplyTos +
+
+
PHPMailer::ClearReplyTos() in class.phpmailer.php
+
Clears all recipients assigned in the ReplyTo array. Returns void.
+
+
+ Close +
+
+
SMTP::Close() in class.smtp.php
+
Closes the socket and cleans up the state of the class.
+
+
+ Connect +
+
+
SMTP::Connect() in class.smtp.php
+
Connect to the server specified on the port specified.
+
+
+ +
+
d
+ +
+
+
+
+ $do_debug +
+
+
SMTP::$do_debug in class.smtp.php
+
Sets whether debugging is turned on
+
+
+ Data +
+
+
SMTP::Data() in class.smtp.php
+
Issues a data command and sends the msg_data to the server
+
+
+ +
+
e
+ +
+
+
+
+ $Encoding +
+
+
PHPMailer::$Encoding in class.phpmailer.php
+
Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable".
+
+
+ $ErrorInfo +
+
+
PHPMailer::$ErrorInfo in class.phpmailer.php
+
Holds the most recent mailer error message.
+
+
+ Expand +
+
+
SMTP::Expand() in class.smtp.php
+
Expand takes the name and asks the server to list all the people who are members of the _list_. Expand will return back and array of the result or false if an error occurs.
+
+
+ +
+
f
+ +
+
+
+
+ $From +
+
+
PHPMailer::$From in class.phpmailer.php
+
Sets the From email address for the message.
+
+
+ $FromName +
+
+
PHPMailer::$FromName in class.phpmailer.php
+
Sets the From name of the message.
+
+
+ +
+
h
+ +
+
+
+
+ $Helo +
+
+
PHPMailer::$Helo in class.phpmailer.php
+
Sets the SMTP HELO of the message (Default is $Hostname).
+
+
+ $Host +
+
+
PHPMailer::$Host in class.phpmailer.php
+
Sets the SMTP hosts. All hosts must be separated by a semicolon. You can also specify a different port for each host by using this format: [hostname:port] (e.g. "smtp1.example.com:25;smtp2.example.com").
+
+
+ $Hostname +
+
+
PHPMailer::$Hostname in class.phpmailer.php
+
Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'.
+
+
+ Hello +
+
+
SMTP::Hello() in class.smtp.php
+
Sends the HELO command to the smtp server.
+
+
+ Help +
+
+
SMTP::Help() in class.smtp.php
+
Gets help information on the keyword specified. If the keyword
+
+
+ +
+
i
+ +
+
+
+
+ IsError +
+
+
PHPMailer::IsError() in class.phpmailer.php
+
Returns true if an error occurred.
+
+
+ IsHTML +
+
+
PHPMailer::IsHTML() in class.phpmailer.php
+
Sets message type to HTML.
+
+
+ IsMail +
+
+
PHPMailer::IsMail() in class.phpmailer.php
+
Sets Mailer to send message using PHP mail() function.
+
+
+ IsQmail +
+
+
PHPMailer::IsQmail() in class.phpmailer.php
+
Sets Mailer to send message using the qmail MTA.
+
+
+ IsSendmail +
+
+
PHPMailer::IsSendmail() in class.phpmailer.php
+
Sets Mailer to send message using the $Sendmail program.
+
+
+ IsSMTP +
+
+
PHPMailer::IsSMTP() in class.phpmailer.php
+
Sets Mailer to send message using SMTP.
+
+
+ +
+
m
+ +
+
+
+
+ $Mailer +
+
+
PHPMailer::$Mailer in class.phpmailer.php
+
Method to send mail: ("mail", "sendmail", or "smtp").
+
+
+ Mail +
+
+
SMTP::Mail() in class.smtp.php
+
Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command.
+
+
+ +
+
n
+ +
+
+
+
+ Noop +
+
+
SMTP::Noop() in class.smtp.php
+
Sends the command NOOP to the SMTP server.
+
+
+ +
+
p
+ +
+
+
+
+ $Password +
+
+
PHPMailer::$Password in class.phpmailer.php
+
Sets SMTP password.
+
+
+ $PluginDir +
+
+
PHPMailer::$PluginDir in class.phpmailer.php
+
Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path.
+
+
+ $Port +
+
+
PHPMailer::$Port in class.phpmailer.php
+
Sets the default SMTP server port.
+
+
+ $Priority +
+
+
PHPMailer::$Priority in class.phpmailer.php
+
Email priority (1 = High, 3 = Normal, 5 = low).
+
+
+ PHPMailer +
+
+
PHPMailer in class.phpmailer.php
+
PHPMailer - PHP email transport class
+
+
+ +
+
q
+ +
+
+
+
+ Quit +
+
+
SMTP::Quit() in class.smtp.php
+
Sends the quit command to the server and then closes the socket if there is no error or the $close_on_error argument is true.
+
+
+ +
+
r
+ +
+
+
+
+ Recipient +
+
+
SMTP::Recipient() in class.smtp.php
+
Sends the command RCPT to the SMTP server with the TO: argument of $to.
+
+
+ Reset +
+
+
SMTP::Reset() in class.smtp.php
+
Sends the RSET command to abort and transaction that is currently in progress. Returns true if successful false otherwise.
+
+
+ +
+
s
+ +
+
+
+
+ $Sender +
+
+
PHPMailer::$Sender in class.phpmailer.php
+
Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+
+
+ $Sendmail +
+
+
PHPMailer::$Sendmail in class.phpmailer.php
+
Sets the path of the sendmail program.
+
+
+ $SMTPAuth +
+
+
PHPMailer::$SMTPAuth in class.phpmailer.php
+
Sets SMTP authentication. Utilizes the Username and Password variables.
+
+
+ $SMTPDebug +
+
+
PHPMailer::$SMTPDebug in class.phpmailer.php
+
Sets SMTP class debugging on or off.
+
+
+ $SMTPKeepAlive +
+
+
PHPMailer::$SMTPKeepAlive in class.phpmailer.php
+
Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().
+
+
+ $SMTP_PORT +
+
+
SMTP::$SMTP_PORT in class.smtp.php
+
SMTP server port
+
+
+ $Subject +
+
+
PHPMailer::$Subject in class.phpmailer.php
+
Sets the Subject of the message.
+
+
+ Send +
+
+
SMTP::Send() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ Send +
+
+
PHPMailer::Send() in class.phpmailer.php
+
Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
+
+
+ SendAndMail +
+
+
SMTP::SendAndMail() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ SendOrMail +
+
+
SMTP::SendOrMail() in class.smtp.php
+
Starts a mail transaction from the email address specified in
+
+
+ SetLanguage +
+
+
PHPMailer::SetLanguage() in class.phpmailer.php
+
Sets the language for all class error messages. Returns false if it cannot load the language file. The default language type is English.
+
+
+ SMTP +
+
+
SMTP::SMTP() in class.smtp.php
+
Initialize the class so that the data is in a known state.
+
+
+ SMTP +
+
+
SMTP in class.smtp.php
+
SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except TURN which will always return a not implemented error. SMTP also provides some utility methods for sending mail to an SMTP server.
+
+
+ SmtpClose +
+
+
PHPMailer::SmtpClose() in class.phpmailer.php
+
Closes the active SMTP session if one exists.
+
+
+ +
+
t
+ +
+
+
+
+ $Timeout +
+
+
PHPMailer::$Timeout in class.phpmailer.php
+
Sets the SMTP server timeout in seconds. This function will not work with the win32 version.
+
+
+ Turn +
+
+
SMTP::Turn() in class.smtp.php
+
This is an optional command for SMTP that this class does not support. This method is here to make the RFC821 Definition complete for this class and __may__ be implimented in the future
+
+
+ +
+
u
+ +
+
+
+
+ $Username +
+
+
PHPMailer::$Username in class.phpmailer.php
+
Sets SMTP username.
+
+
+ +
+
v
+ +
+
+
+
+ $Version +
+
+
PHPMailer::$Version in class.phpmailer.php
+
Holds PHPMailer version.
+
+
+ Verify +
+
+
SMTP::Verify() in class.smtp.php
+
Verifies that the name is recognized by the server.
+
+
+ +
+
w
+ +
+
+
+
+ $WordWrap +
+
+
PHPMailer::$WordWrap in class.phpmailer.php
+
Sets word wrapping on the body of the message to a given number of characters.
+
+
+ +
+ a + b + c + d + e + f + h + i + m + n + p + q + r + s + t + u + v + w +
+ \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/errors.html b/inc/classes/third_party/php_mailer/phpdoc/errors.html new file mode 100644 index 0000000..d5781a0 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/errors.html @@ -0,0 +1,23 @@ + + + + + + phpDocumentor Parser Errors and Warnings + + + + + Post-parsing
+class.smtp.php
+

class.phpmailer.php

+

Warnings:


+Warning on line 1530 - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.phpmailer.php
+

class.smtp.php

+

Warnings:


+Warning on line 1039 - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.smtp.php
+

+ Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by phpDocumentor 1.2.0 +

+ + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/index.html b/inc/classes/third_party/php_mailer/phpdoc/index.html new file mode 100644 index 0000000..f2b2c7a --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/index.html @@ -0,0 +1,24 @@ + + + + + + Generated Documentation + + + + + + + + + + + <H2>Frame Alert</H2> + <P>This document is designed to be viewed using the frames feature. + If you see this message, you are using a non-frame-capable web client.</P> + + + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html new file mode 100644 index 0000000..ec8456a --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html @@ -0,0 +1,36 @@ + + + + + + + + + + +
PHPMailer
+
+ +
+ +
Description
+
+ Class trees
+ Index of elements
+
+ + + +
Classes
+
PHPMailer
+
SMTP
+
Files
+
class.phpmailer.php
+
class.smtp.php
+ + +
+
+

phpDocumentor v 1.2.0

+ + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/phpdoc/media/banner.css b/inc/classes/third_party/php_mailer/phpdoc/media/banner.css new file mode 100644 index 0000000..f2149eb --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/media/banner.css @@ -0,0 +1,32 @@ +body +{ + background-color: #CCCCFF; + margin: 0px; + padding: 0px; +} + +/* Banner (top bar) classes */ + +.banner { } + +.banner-menu +{ + clear: both; + padding: .5em; + border-top: 2px solid #6666AA; +} + +.banner-title +{ + text-align: right; + font-size: 20pt; + font-weight: bold; + margin: .2em; +} + +.package-selector +{ + background-color: #AAAADD; + border: 1px solid black; + color: yellow; +} diff --git a/inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css b/inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css new file mode 100644 index 0000000..7a81139 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css @@ -0,0 +1,133 @@ +a { color: #336699; text-decoration: none; } +a:hover { color: #6699CC; text-decoration: underline; } +a:active { color: #6699CC; text-decoration: underline; } + +body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt } +p, li { line-height: 140% } +a img { border: 0px; } +dd { margin-left: 0px; padding-left: 1em; } + +/* Page layout/boxes */ + +.info-box {} +.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF } +.info-box-body { border: 1px solid #999999; padding: .5em; } +.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } + +.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} +.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} + +.page-body { max-width: 800px; margin: auto; } +.tree dl { margin: 0px } + +/* Index formatting classes */ + +.index-item-body { margin-top: .5em; margin-bottom: .5em} +.index-item-description { margin-top: .25em } +.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } +.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} +.index-letter-title { font-size: 12pt; font-weight: bold } +.index-letter-menu { text-align: center; margin: 1em } +.index-letter { font-size: 12pt } + +/* Docbook classes */ + +.description {} +.short-description { font-weight: bold; color: #666666; } +.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } +.parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; } +.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } +.package { } +.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } +.package-details { font-size: 85%; } +.sub-package { font-weight: bold; font-size: 120% } +.tutorial { border-width: thin; border-color: #0066ff } +.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } +.nav-button-disabled { color: #999999; } +.nav-button:active, +.nav-button:focus, +.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none } +.folder-title { font-style: italic } + +/* Generic formatting */ + +.field { font-weight: bold; } +.detail { font-size: 8pt; } +.notes { font-style: italic; font-size: 8pt; } +.separator { background-color: #999999; height: 2px; } +.warning { color: #FF6600; } +.disabled { font-style: italic; color: #999999; } + +/* Code elements */ + +.line-number { } + +.class-table { width: 100%; } +.class-table-header { border-bottom: 1px dotted #666666; text-align: left} +.class-name { color: #000000; font-weight: bold; } + +.method-summary { padding-left: 1em; font-size: 8pt } +.method-header { } +.method-definition { margin-bottom: .3em } +.method-title { font-weight: bold; } +.method-name { font-weight: bold; } +.method-signature { font-size: 85%; color: #666666; margin: .5em 0em } +.method-result { font-style: italic; } + +.var-summary { padding-left: 1em; font-size: 8pt; } +.var-header { } +.var-title { margin-bottom: .3em } +.var-type { font-style: italic; } +.var-name { font-weight: bold; } +.var-default {} +.var-description { font-weight: normal; color: #000000; } + +.include-title { } +.include-type { font-style: italic; } +.include-name { font-weight: bold; } + +.const-title { } +.const-name { font-weight: bold; } + +/* Syntax highlighting */ + +.src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; } + +.src-comm { color: green; } +.src-id { } +.src-inc { color: #0000FF; } +.src-key { color: #0000FF; } +.src-num { color: #CC0000; } +.src-str { color: #66cccc; } +.src-sym { font-weight: bold; } +.src-var { } + +.src-php { font-weight: bold; } + +.src-doc { color: #009999 } +.src-doc-close-template { color: #0000FF } +.src-doc-coretag { color: #0099FF; font-weight: bold } +.src-doc-inlinetag { color: #0099FF } +.src-doc-internal { color: #6699cc } +.src-doc-tag { color: #0080CC } +.src-doc-template { color: #0000FF } +.src-doc-type { font-style: italic } +.src-doc-var { font-style: italic } + +/* tutorial */ + +.authors { } +.author { font-style: italic; font-weight: bold } +.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } +.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em } +.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap } +.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } +.ref-title-box { } +.ref-title { } +.ref-purpose { font-style: italic; color: #666666 } +.ref-synopsis { } +.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF } +.cmd-synopsis { margin: 1em 0em } +.cmd-title { font-weight: bold } +.toc { margin-left: 2em; padding-left: 0em } + diff --git a/inc/classes/third_party/php_mailer/phpdoc/packages.html b/inc/classes/third_party/php_mailer/phpdoc/packages.html new file mode 100644 index 0000000..fdf40b0 --- /dev/null +++ b/inc/classes/third_party/php_mailer/phpdoc/packages.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inc/classes/third_party/php_mailer/test/phpmailer_test.php b/inc/classes/third_party/php_mailer/test/phpmailer_test.php new file mode 100644 index 0000000..22d6f42 --- /dev/null +++ b/inc/classes/third_party/php_mailer/test/phpmailer_test.php @@ -0,0 +1,572 @@ +TestCase( $name ); + } + + /** + * Run before each test is started. + */ + function setUp() { + global $global_vars; + global $INCLUDE_DIR; + + $this->Mail = new PHPMailer(); + + $this->Mail->Priority = 3; + $this->Mail->Encoding = "8bit"; + $this->Mail->CharSet = "iso-8859-1"; + $this->Mail->From = "unit_test@phpmailer.sf.net"; + $this->Mail->FromName = "Unit Tester"; + $this->Mail->Sender = ""; + $this->Mail->Subject = "Unit Test"; + $this->Mail->Body = ""; + $this->Mail->AltBody = ""; + $this->Mail->WordWrap = 0; + $this->Mail->Host = $global_vars["mail_host"]; + $this->Mail->Port = 25; + $this->Mail->Helo = "localhost.localdomain"; + $this->Mail->SMTPAuth = false; + $this->Mail->Username = ""; + $this->Mail->Password = ""; + $this->Mail->PluginDir = $INCLUDE_DIR; + $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy"); + $this->Mail->Sender = "unit_test@phpmailer.sf.net"; + + if(strlen($this->Mail->Host) > 0) + $this->Mail->Mailer = "smtp"; + else + { + $this->Mail->Mailer = "mail"; + $this->Sender = "unit_test@phpmailer.sf.net"; + } + + global $global_vars; + $this->SetAddress($global_vars["mail_to"], "Test User"); + if(strlen($global_vars["mail_cc"]) > 0) + $this->SetAddress($global_vars["mail_cc"], "Carbon User", "cc"); + } + + /** + * Run after each test is completed. + */ + function tearDown() { + // Clean global variables + $this->Mail = NULL; + $this->ChangeLog = array(); + $this->NoteLog = array(); + } + + + /** + * Build the body of the message in the appropriate format. + * @private + * @returns void + */ + function BuildBody() { + $this->CheckChanges(); + + // Determine line endings for message + if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0) + { + $eol = "
"; + $bullet = "
  • "; + $bullet_start = "
      "; + $bullet_end = "
    "; + } + else + { + $eol = "\n"; + $bullet = " - "; + $bullet_start = ""; + $bullet_end = ""; + } + + $ReportBody = ""; + + $ReportBody .= "---------------------" . $eol; + $ReportBody .= "Unit Test Information" . $eol; + $ReportBody .= "---------------------" . $eol; + $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol; + $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol; + + if(strlen($this->Mail->Host) > 0) + $ReportBody .= "Host: " . $this->Mail->Host . $eol; + + // If attachments then create an attachment list + if(count($this->Mail->attachment) > 0) + { + $ReportBody .= "Attachments:" . $eol; + $ReportBody .= $bullet_start; + for($i = 0; $i < count($this->Mail->attachment); $i++) + { + $ReportBody .= $bullet . "Name: " . $this->Mail->attachment[$i][1] . ", "; + $ReportBody .= "Encoding: " . $this->Mail->attachment[$i][3] . ", "; + $ReportBody .= "Type: " . $this->Mail->attachment[$i][4] . $eol; + } + $ReportBody .= $bullet_end . $eol; + } + + // If there are changes then list them + if(count($this->ChangeLog) > 0) + { + $ReportBody .= "Changes" . $eol; + $ReportBody .= "-------" . $eol; + + $ReportBody .= $bullet_start; + for($i = 0; $i < count($this->ChangeLog); $i++) + { + $ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" . + $this->ChangeLog[$i][1] . "]" . $eol; + } + $ReportBody .= $bullet_end . $eol . $eol; + } + + // If there are notes then list them + if(count($this->NoteLog) > 0) + { + $ReportBody .= "Notes" . $eol; + $ReportBody .= "-----" . $eol; + + $ReportBody .= $bullet_start; + for($i = 0; $i < count($this->NoteLog); $i++) + { + $ReportBody .= $bullet . $this->NoteLog[$i] . $eol; + } + $ReportBody .= $bullet_end; + } + + // Re-attach the original body + $this->Mail->Body .= $eol . $eol . $ReportBody; + } + + /** + * Check which default settings have been changed for the report. + * @private + * @returns void + */ + function CheckChanges() { + if($this->Mail->Priority != 3) + $this->AddChange("Priority", $this->Mail->Priority); + if($this->Mail->Encoding != "8bit") + $this->AddChange("Encoding", $this->Mail->Encoding); + if($this->Mail->CharSet != "iso-8859-1") + $this->AddChange("CharSet", $this->Mail->CharSet); + if($this->Mail->Sender != "") + $this->AddChange("Sender", $this->Mail->Sender); + if($this->Mail->WordWrap != 0) + $this->AddChange("WordWrap", $this->Mail->WordWrap); + if($this->Mail->Mailer != "mail") + $this->AddChange("Mailer", $this->Mail->Mailer); + if($this->Mail->Port != 25) + $this->AddChange("Port", $this->Mail->Port); + if($this->Mail->Helo != "localhost.localdomain") + $this->AddChange("Helo", $this->Mail->Helo); + if($this->Mail->SMTPAuth) + $this->AddChange("SMTPAuth", "true"); + } + + /** + * Adds a change entry. + * @private + * @returns void + */ + function AddChange($sName, $sNewValue) { + $cur = count($this->ChangeLog); + $this->ChangeLog[$cur][0] = $sName; + $this->ChangeLog[$cur][1] = $sNewValue; + } + + /** + * Adds a simple note to the message. + * @public + * @returns void + */ + function AddNote($sValue) { + $this->NoteLog[] = $sValue; + } + + /** + * Adds all of the addresses + * @public + * @returns void + */ + function SetAddress($sAddress, $sName = "", $sType = "to") { + switch($sType) + { + case "to": + $this->Mail->AddAddress($sAddress, $sName); + break; + case "cc": + $this->Mail->AddCC($sAddress, $sName); + break; + case "bcc": + $this->Mail->AddBCC($sAddress, $sName); + break; + } + } + + ///////////////////////////////////////////////// + // UNIT TESTS + ///////////////////////////////////////////////// + + /** + * Try a plain message. + */ + function test_WordWrap() { + + $this->Mail->WordWrap = 40; + $my_body = "Here is the main body of this message. It should " . + "be quite a few lines. It should be wrapped at the " . + "40 characters. Make sure that it is."; + $nBodyLen = strlen($my_body); + $my_body .= "\n\nThis is the above body length: " . $nBodyLen; + + $this->Mail->Body = $my_body; + $this->Mail->Subject .= ": Wordwrap"; + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Try a plain message. + */ + function test_Low_Priority() { + + $this->Mail->Priority = 5; + $this->Mail->Body = "Here is the main body. There should be " . + "a reply to address in this message."; + $this->Mail->Subject .= ": Low Priority"; + $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)"); + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Simple plain file attachment test. + */ + function test_Multiple_Plain_FileAttachment() { + + $this->Mail->Body = "Here is the text body"; + $this->Mail->Subject .= ": Plain + Multiple FileAttachments"; + + if(!$this->Mail->AddAttachment("test.png")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Simple plain string attachment test. + */ + function test_Plain_StringAttachment() { + + $this->Mail->Body = "Here is the text body"; + $this->Mail->Subject .= ": Plain + StringAttachment"; + + $sAttachment = "These characters are the content of the " . + "string attachment.\nThis might be taken from a ". + "database or some other such thing. "; + + $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt"); + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Plain quoted-printable message. + */ + function test_Quoted_Printable() { + + $this->Mail->Body = "Here is the main body"; + $this->Mail->Subject .= ": Plain + Quoted-printable"; + $this->Mail->Encoding = "quoted-printable"; + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Try a plain message. + */ + function test_Html() { + + $this->Mail->IsHTML(true); + $this->Mail->Subject .= ": HTML only"; + + $this->Mail->Body = "This is a test message written in HTML.
    " . + "Go to " . + "http://phpmailer.sourceforge.net/ for new versions of " . + "phpmailer.

    Thank you!"; + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Simple HTML and attachment test + */ + function test_HTML_Attachment() { + + $this->Mail->Body = "This is the HTML part of the email."; + $this->Mail->Subject .= ": HTML + Attachment"; + $this->Mail->IsHTML(true); + + if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * An embedded attachment test. + */ + function test_Embedded_Image() { + + $this->Mail->Body = "Embedded Image: \"phpmailer\"" . + "Here is an image!"; + $this->Mail->Subject .= ": Embedded Image"; + $this->Mail->IsHTML(true); + + if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png", + "base64", "image/png")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * An embedded attachment test. + */ + function test_Multi_Embedded_Image() { + + $this->Mail->Body = "Embedded Image: \"phpmailer\"" . + "Here is an image!"; + $this->Mail->Subject .= ": Embedded Image + Attachment"; + $this->Mail->IsHTML(true); + + if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png", + "base64", "image/png")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Simple multipart/alternative test. + */ + function test_AltBody() { + + $this->Mail->Body = "This is the HTML part of the email."; + $this->Mail->AltBody = "Here is the text body of this message. " . + "It should be quite a few lines. It should be wrapped at the " . + "40 characters. Make sure that it is."; + $this->Mail->WordWrap = 40; + $this->AddNote("This is a mulipart alternative email"); + $this->Mail->Subject .= ": AltBody + Word Wrap"; + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + /** + * Simple HTML and attachment test + */ + function test_AltBody_Attachment() { + + $this->Mail->Body = "This is the HTML part of the email."; + $this->Mail->AltBody = "This is the text part of the email."; + $this->Mail->Subject .= ": AltBody + Attachment"; + $this->Mail->IsHTML(true); + + if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt")) + { + $this->assert(false, $this->Mail->ErrorInfo); + return; + } + + $this->BuildBody(); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + + $fp = fopen("message.txt", "w"); + fwrite($fp, $this->Mail->CreateHeader() . $this->Mail->CreateBody()); + fclose($fp); + } + + function test_MultipleSend() { + $this->Mail->Body = "Sending two messages without keepalive"; + $this->BuildBody(); + $subject = $this->Mail->Subject; + + $this->Mail->Subject = $subject . ": SMTP 1"; + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + + $this->Mail->Subject = $subject . ": SMTP 2"; + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + function test_SmtpKeepAlive() { + $this->Mail->Body = "This was done using the SMTP keep-alive."; + $this->BuildBody(); + $subject = $this->Mail->Subject; + + $this->Mail->SMTPKeepAlive = true; + $this->Mail->Subject = $subject . ": SMTP keep-alive 1"; + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + + $this->Mail->Subject = $subject . ": SMTP keep-alive 2"; + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->Mail->SmtpClose(); + } + + /** + * Tests this denial of service attack: + * http://www.cybsec.com/vuln/PHPMailer-DOS.pdf + */ + function test_DenialOfServiceAttack() { + $this->Mail->Body = "This should no longer cause a denial of service."; + $this->BuildBody(); + + $this->Mail->Subject = str_repeat("A", 998); + $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + function test_Error() { + $this->Mail->Subject .= ": This should be sent"; + $this->BuildBody(); + $this->Mail->ClearAllRecipients(); // no addresses should cause an error + $this->assert($this->Mail->IsError() == false, "Error found"); + $this->assert($this->Mail->Send() == false, "Send succeeded"); + $this->assert($this->Mail->IsError(), "No error found"); + $this->assertEquals('You must provide at least one ' . + 'recipient email address.', $this->Mail->ErrorInfo); + $this->Mail->AddAddress(get("mail_to")); + $this->assert($this->Mail->Send(), "Send failed"); + } +} + +/** + * Create and run test instance. + */ + +if(isset($HTTP_GET_VARS)) + $global_vars = $HTTP_GET_VARS; +else + $global_vars = $_REQUEST; + +if(isset($global_vars["submitted"])) +{ + echo "Test results:
    "; + $suite = new TestSuite( "phpmailerTest" ); + + $testRunner = new TestRunner; + $testRunner->run($suite); + echo "


    "; +} + +function get($sName) { + global $global_vars; + if(isset($global_vars[$sName])) + return $global_vars[$sName]; + else + return ""; +} + +?> + + + +

    phpmailer Unit Test

    +By entering a SMTP hostname it will automatically perform tests with SMTP. + +
    + +To Address: "/> +
    +Cc Address: "/> +
    +SMTP Hostname: "/> +

    + + +

    + + diff --git a/inc/classes/third_party/php_mailer/test/phpunit.php b/inc/classes/third_party/php_mailer/test/phpunit.php new file mode 100644 index 0000000..1d50868 --- /dev/null +++ b/inc/classes/third_party/php_mailer/test/phpunit.php @@ -0,0 +1,376 @@ + +// OntoSys, Inc +// +// $Id: phpunit.php,v 1.1 2002/03/30 19:32:17 bmatzelle Exp $ + +// Copyright (c) 2000 Fred Yankowski + +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, copy, +// modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | + E_CORE_ERROR | E_CORE_WARNING); + +/* +interface Test { + function run(&$aTestResult); + function countTestCases(); +} +*/ + +function trace($msg) { + return; + print($msg); + flush(); +} + + +class Exception { + /* Emulate a Java exception, sort of... */ + var $message; + function Exception($message) { + $this->message = $message; + } + function getMessage() { + return $this->message; + } +} + +class Assert { + function assert($boolean, $message=0) { + if (! $boolean) + $this->fail($message); + } + + function assertEquals($expected, $actual, $message=0) { + if ($expected != $actual) { + $this->failNotEquals($expected, $actual, "expected", $message); + } + } + + function assertRegexp($regexp, $actual, $message=false) { + if (! preg_match($regexp, $actual)) { + $this->failNotEquals($regexp, $actual, "pattern", $message); + } + } + + function failNotEquals($expected, $actual, $expected_label, $message=0) { + // Private function for reporting failure to match. + $str = $message ? ($message . ' ') : ''; + $str .= "($expected_label/actual)
    "; + $htmlExpected = htmlspecialchars($expected); + $htmlActual = htmlspecialchars($actual); + $str .= sprintf("
    %s\n--------\n%s
    ", + $htmlExpected, $htmlActual); + $this->fail($str); + } +} + +class TestCase extends Assert /* implements Test */ { + /* Defines context for running tests. Specific context -- such as + instance variables, global variables, global state -- is defined + by creating a subclass that specializes the setUp() and + tearDown() methods. A specific test is defined by a subclass + that specializes the runTest() method. */ + var $fName; + var $fResult; + var $fExceptions = array(); + + function TestCase($name) { + $this->fName = $name; + } + + function run($testResult=0) { + /* Run this single test, by calling the run() method of the + TestResult object which will in turn call the runBare() method + of this object. That complication allows the TestResult object + to do various kinds of progress reporting as it invokes each + test. Create/obtain a TestResult object if none was passed in. + Note that if a TestResult object was passed in, it must be by + reference. */ + if (! $testResult) + $testResult = $this->_createResult(); + $this->fResult = $testResult; + $testResult->run(&$this); + $this->fResult = 0; + return $testResult; + } + + function countTestCases() { + return 1; + } + + function runTest() { + $name = $this->name(); + // Since isset($this->$name) is false, no way to run defensive checks + $this->$name(); + } + + function setUp() /* expect override */ { + //print("TestCase::setUp()
    \n"); + } + + function tearDown() /* possible override */ { + //print("TestCase::tearDown()
    \n"); + } + + //////////////////////////////////////////////////////////////// + + + function _createResult() /* protected */ { + /* override this to use specialized subclass of TestResult */ + return new TestResult; + } + + function fail($message=0) { + //printf("TestCase::fail(%s)
    \n", ($message) ? $message : ''); + /* JUnit throws AssertionFailedError here. We just record the + failure and carry on */ + $this->fExceptions[] = new Exception(&$message); + } + + function error($message) { + /* report error that requires correction in the test script + itself, or (heaven forbid) in this testing infrastructure */ + printf('ERROR: ' . $message . '
    '); + $this->fResult->stop(); + } + + function failed() { + return count($this->fExceptions); + } + + function getExceptions() { + return $this->fExceptions; + } + + function name() { + return $this->fName; + } + + function runBare() { + $this->setup(); + $this->runTest(); + $this->tearDown(); + } +} + + +class TestSuite /* implements Test */ { + /* Compose a set of Tests (instances of TestCase or TestSuite), and + run them all. */ + var $fTests = array(); + + function TestSuite($classname=false) { + if ($classname) { + // Find all methods of the given class whose name starts with + // "test" and add them to the test suite. We are just _barely_ + // able to do this with PHP's limited introspection... Note + // that PHP seems to store method names in lower case, and we + // have to avoid the constructor function for the TestCase class + // superclass. This will fail when $classname starts with + // "Test" since that will have a constructor method that will + // get matched below and then treated (incorrectly) as a test + // method. So don't name any TestCase subclasses as "Test..."! + if (floor(phpversion()) >= 4) { + // PHP4 introspection, submitted by Dylan Kuhn + $names = get_class_methods($classname); + while (list($key, $method) = each($names)) { + if (preg_match('/^test/', $method) && $method != "testcase") { + $this->addTest(new $classname($method)); + } + } + } + else { + $dummy = new $classname("dummy"); + $names = (array) $dummy; + while (list($key, $value) = each($names)) { + $type = gettype($value); + if ($type == "user function" && preg_match('/^test/', $key) + && $key != "testcase") { + $this->addTest(new $classname($key)); + } + } + } + } + } + + function addTest($test) { + /* Add TestCase or TestSuite to this TestSuite */ + $this->fTests[] = $test; + } + + function run(&$testResult) { + /* Run all TestCases and TestSuites comprising this TestSuite, + accumulating results in the given TestResult object. */ + reset($this->fTests); + while (list($na, $test) = each($this->fTests)) { + if ($testResult->shouldStop()) + break; + $test->run(&$testResult); + } + } + + function countTestCases() { + /* Number of TestCases comprising this TestSuite (including those + in any constituent TestSuites) */ + $count = 0; + reset($fTests); + while (list($na, $test_case) = each($this->fTests)) { + $count += $test_case->countTestCases(); + } + return $count; + } +} + + +class TestFailure { + /* Record failure of a single TestCase, associating it with the + exception(s) that occurred */ + var $fFailedTestName; + var $fExceptions; + + function TestFailure(&$test, &$exceptions) { + $this->fFailedTestName = $test->name(); + $this->fExceptions = $exceptions; + } + + function getExceptions() { + return $this->fExceptions; + } + function getTestName() { + return $this->fFailedTestName; + } +} + + +class TestResult { + /* Collect the results of running a set of TestCases. */ + var $fFailures = array(); + var $fRunTests = 0; + var $fStop = false; + + function TestResult() { } + + function _endTest($test) /* protected */ { + /* specialize this for end-of-test action, such as progress + reports */ + } + + function getFailures() { + return $this->fFailures; + } + + function run($test) { + /* Run a single TestCase in the context of this TestResult */ + $this->_startTest($test); + $this->fRunTests++; + + $test->runBare(); + + /* this is where JUnit would catch AssertionFailedError */ + $exceptions = $test->getExceptions(); + if ($exceptions) + $this->fFailures[] = new TestFailure(&$test, &$exceptions); + $this->_endTest($test); + } + + function countTests() { + return $this->fRunTests; + } + + function shouldStop() { + return $this->fStop; + } + + function _startTest($test) /* protected */ { + /* specialize this for start-of-test actions */ + } + + function stop() { + /* set indication that the test sequence should halt */ + $fStop = true; + } + + function countFailures() { + return count($this->fFailures); + } +} + + +class TextTestResult extends TestResult { + /* Specialize TestResult to produce text/html report */ + function TextTestResult() { + $this->TestResult(); // call superclass constructor + } + + function report() { + /* report result of test run */ + $nRun = $this->countTests(); + $nFailures = $this->countFailures(); + printf("

    %s test%s run
    ", $nRun, ($nRun == 1) ? '' : 's'); + printf("%s failure%s.
    \n", $nFailures, ($nFailures == 1) ? '' : 's'); + if ($nFailures == 0) + return; + + print("

      \n"); + $failures = $this->getFailures(); + while (list($i, $failure) = each($failures)) { + $failedTestName = $failure->getTestName(); + printf("
    1. %s\n", $failedTestName); + + $exceptions = $failure->getExceptions(); + print("
        "); + while (list($na, $exception) = each($exceptions)) + printf("
      • %s\n", $exception->getMessage()); + print("
      "); + } + print("
    \n"); + } + + function _startTest($test) { + printf("%s ", $test->name()); + flush(); + } + + function _endTest($test) { + $outcome = $test->failed() + ? "FAIL" + : "ok"; + printf("$outcome
    \n"); + flush(); + } +} + + +class TestRunner { + /* Run a suite of tests and report results. */ + function run($suite) { + $result = new TextTestResult; + $suite->run($result); + $result->report(); + } +} + +?> diff --git a/inc/classes/third_party/php_mailer/test/test.png b/inc/classes/third_party/php_mailer/test/test.png new file mode 100644 index 0000000..02de5a7 Binary files /dev/null and b/inc/classes/third_party/php_mailer/test/test.png differ diff --git a/inc/config.php b/inc/config.php index 0bdd034..7ac8fa9 100644 --- a/inc/config.php +++ b/inc/config.php @@ -209,6 +209,9 @@ $cfg->setConfigEntry('account_password_class', "AccountPasswordVerifierFilter"); // CFG: USER-STATUS-CLASS $cfg->setConfigEntry('user_status_class', "UserStatusVerifierFilter"); +// CFG: USER-UNCONFIRMED-CLASS +$cfg->setConfigEntry('user_unconfirmed_class', "UserUnconfirmedVerifierFilter"); + // CFG: CRYPTO-HELPER $cfg->setConfigEntry('crypto_class', "CryptoHelper");