### PHPMailer Example Updates Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md New examples are provided for both basic and advanced usage of PHPMailer. Advanced examples specifically demonstrate proper exception handling techniques. ```APIDOC PHPMailer Examples: - Basic Usage Examples - Advanced Usage Examples (including Exception Handling) ``` -------------------------------- ### Send Email with PHPMailer via SMTP Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/README.md This example demonstrates how to send an email using PHPMailer with SMTP authentication. It covers setting up SMTP host, port, credentials, adding recipients, attachments, and defining HTML and plain text body content. Error handling for mail sending is also included. ```php SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'user@example.com'; // SMTP username $mail->Password = 'secret'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->From = 'from@example.com'; $mail->FromName = 'Mailer'; $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient $mail->addAddress('ellen@example.com'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); $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; } else { echo 'Message has been sent'; } ``` -------------------------------- ### PHPMailer Test Script Utility Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md A new test script is available to validate PHPMailer installations. It sends multi-MIME emails with inline graphics and attachments, and outputs functional PHP code snippets that users can copy to replicate the email sending functionality. ```APIDOC Test Script Features: - Sends multi-MIME emails - Supports HTML email with inline graphics - Includes multiple attachments (demonstrates duplicate handling) - Displays functional PHP code for replication ``` -------------------------------- ### PCLZIP General Improvements and Bug Fixes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Summarizes various performance enhancements, bug corrections, and internal management improvements across the PCLZIP library. ```APIDOC General Improvements: - Algorithm Performance: Improved by removing temporary file usage during add/extract operations. - Empty Filename Zipping: Correct detection for cases where removed path is same as zipped dir (dir content is zipped, dir itself is filtered). - Windows Paths: Better support for Windows file paths. - add() Method Bug: Corrected issue where add() failed if archive file existed with size=0 (fixed in v2.0). - OS_WINDOWS Constant: Removed usage; now uses php_uname() for OS detection. - Index Range Control: Improved control over the order of index ranges in extract by index feature. - Folder Management: Changed internal management of folders for better handling of internal flags. ``` -------------------------------- ### PCLZIP File Addition API Enhancements Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Introduces the `PCLZIP_OPT_NO_COMPRESSION` attribute for the `add()` method, allowing files to be added to an archive without compression. ```APIDOC PCLZIP Method: add() Description: Adds files to an archive. Optional Parameters: - PCLZIP_OPT_NO_COMPRESSION: Adds files without applying compression. ``` -------------------------------- ### PCLZIP Callback Options for File Operations Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Details the new callback options that can be triggered during file addition and extraction, enabling custom logic before and after these operations. ```APIDOC PCLZIP Callback Options: Description: Callbacks are triggered during add or extract operations, allowing custom logic. Applicable Functions: extract(), extractByIndex(), create(), add(). Callbacks: - PCLZIP_CB_PRE_EXTRACT: Called before each file extraction. - User can change filename or skip extraction (adds 'skipped' status). - PCLZIP_CB_POST_EXTRACT: Called after each file extraction. - PCLZIP_CB_PRE_ADD: Called before each file addition. - User can change stored filename or skip addition (adds 'skipped' status). - PCLZIP_CB_POST_ADD: Called after each file addition. ``` -------------------------------- ### Expose PreSend() and PostSend() as Public Methods Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md The `PreSend()` and `PostSend()` methods have been exposed as public, providing greater control over the message sending process, particularly useful when serializing message transmission. ```APIDOC PHPMailer::PreSend(): public method PHPMailer::PostSend(): public method ``` -------------------------------- ### PCLZIP Direct String Extraction Option Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Documents the `PCLZIP_OPT_EXTRACT_AS_STRING` attribute, which enables direct extraction of file content into a string, bypassing the need for temporary files. ```APIDOC PCLZIP Attribute: PCLZIP_OPT_EXTRACT_AS_STRING Description: Allows extracting a file's content directly into a string, eliminating the use of file system operations (no temporary files). ``` -------------------------------- ### PCLZIP Version 1.3 Core API Changes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Outlines fundamental changes introduced in PCLZIP Version 1.3, including error handling overhaul, removal of deprecated practices, and adoption of variable options for key functions. ```APIDOC PCLZIP Version 1.3 Core Changes: - Double Include Check: Removed; now relies on PHP's include_once() and require_once(). - Error Handling Mechanism: Replaced external error library with internal methods. - PclError...() functions replaced by internal equivalents. - PCLZIP_ERROR_EXTERNAL environment variable can re-enable former library. - Error Codes: Now use constants instead of integer values. - Error Functions: Introduced errorCode(), errorName(), and errorInfo(). - Deprecated Call by Reference: Removed usage of functions with arguments passed by reference. - Variable Options: extract(), extractByIndex(), create(), and add() functions now accept variable options instead of fixed arguments. ``` -------------------------------- ### PCLZIP Filename Separator Configuration Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Describes the new `PCLZIP_SEPARATOR` constant for configuring filename separators, noting a backward-incompatible change to the default separator. ```APIDOC PCLZIP Constant: PCLZIP_SEPARATOR Description: Used for static configuration of filename separators in a single string. Default Value: Comma (',') (previously blank space). Note: This change breaks backward compatibility; scripts may need adjustment. ``` -------------------------------- ### PHPMailer 2.1.0 Beta 2 Release Notes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Version 2.1.0 Beta 2 includes an updated `EncodeQP` implementation and has undergone extensive testing. It is explicitly noted that this version is not compatible with PHP4 and is intended for testing purposes only, not production environments. ```APIDOC PHPMailer 2.1.0 Beta 2: - Implemented updated EncodeQP. - All known bugs corrected, enhancements tested. - Compatibility: NOT compatible with PHP4. - Usage Warning: STRICTLY FOR TESTING, DO NOT USE IN PRODUCTION. ``` -------------------------------- ### PCLZIP File Deletion API Enhancements Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Details the new optional parameters available for the `delete()` method in the PCLZIP library, allowing for more flexible file removal based on index, name, or regular expressions. ```APIDOC PCLZIP Method: delete() Description: Removes files from an archive. Optional Parameters: - PCLZIP_OPT_BY_INDEX: Deletes files specified by their index. - PCLZIP_OPT_BY_NAME: Deletes files specified by their name. - PCLZIP_OPT_BY_EREG: Deletes files matching a POSIX regular expression. - PCLZIP_OPT_BY_PREG: Deletes files matching a PCRE regular expression. ``` -------------------------------- ### Implement Callback Function Support Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Callback function support has been added, allowing custom logic to be executed during the email sending process. The callback function receives parameters including the result, recipients (to, cc, bcc), subject, and body of the email. ```APIDOC Callback Function Signature: function(result, to, cc, bcc, subject, body) ``` -------------------------------- ### PCLZIP File Extraction API Enhancements Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Describes the expanded capabilities of the `extract()` method, enabling extraction of files by regular expression, index, or name, providing more granular control over the extraction process. ```APIDOC PCLZIP Method: extract() Description: Extracts files from an archive. Optional Parameters: - PCLZIP_OPT_BY_EREG: Extracts files matching a POSIX regular expression. - PCLZIP_OPT_BY_PREG: Extracts files matching a PCRE regular expression. - PCLZIP_OPT_BY_INDEX: Extracts files specified by their index (improves on extractByIndex()). - PCLZIP_OPT_BY_NAME: Extracts files specified by their name or an array of names. Supports folder extraction by appending '/' to the folder name. ``` -------------------------------- ### PHPMailer 2.2 Compatibility and Bug Fixes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Version 2.2 improves UTF-8 handling in redirects, corrects a function declaration in `class.pop3.php`, and ensures PHP6 compliance. It also includes a critical fix for an endless loop in `class.smtp.php`. ```APIDOC PHPMailer 2.2 Updates: - Fixed UTF-8 display in redirect issues. - Corrected getResponse function declaration in class.pop3.php. - Achieved PHP6 compliance. - Fixed endless loop on line 1092 in class.smtp.php (missing '=' sign). ``` -------------------------------- ### PCLZIP File List Result Statuses Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Explains the new statuses ('skipped' and 'filename_too_long') that can be returned in the file list result of PCLZIP functions. ```APIDOC PCLZIP File List Result Statuses: - 'skipped': Indicates a file was skipped, typically due to a callback function's request. - 'filename_too_long': Indicates the filename exceeded length limits. ``` -------------------------------- ### PCLZIP Path Removal Option Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Introduces the `PCLZIP_OPT_REMOVE_ALL_PATH` option, allowing users to remove all file path information during add or extract operations without specifying the path to remove. ```APIDOC PCLZIP Option: PCLZIP_OPT_REMOVE_ALL_PATH Description: Removes all file path information when adding or extracting files. Applicable Functions: extract(), extractByIndex(), create(), add(). ``` -------------------------------- ### PCLZIP File Mode Change Option Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPOffice/PHPExcel/Shared/PCLZip/readme.txt Documents the `PCLZIP_OPT_SET_CHMOD` option, which provides the ability to change the file mode (permissions) after extraction. ```APIDOC PCLZIP Option: PCLZIP_OPT_SET_CHMOD Description: Allows setting the file mode (permissions) using chmod() after extraction. Applicable Functions: extract(), extractByIndex(). ``` -------------------------------- ### PHPMailer 2.1 Major Features and API Enhancements Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Version 2.1 introduces significant features like S/MIME digital signing and full E_STRICT compatibility. It also enhances `MsgHTML` with base directory support, improves multibyte character handling, allows custom Message IDs, and includes various bug fixes for robust email composition. ```APIDOC PHPMailer 2.1 API/Feature Enhancements: - S/MIME Functionality: - Added ability to digitally sign emails. - New Sign method: - Sign(private_key_filename: string, password: string) - Sends email with content-type multipart/signed and digital signature. - MsgHTML Function Enhancements: - MsgHTML(message: string, basedir: string = '') - basedir: Fully qualified path for embedded images. - Embedded images with protocol:// (e.g., http://) will not be altered or embedded. - Enhanced HTML to text conversion. - General Improvements: - Fixed return value of SMTP exit code (pclose). - Addressed multibyte character issues in subject lines (truncation). - Added ability for user-specified Message ID (default is still auto-generated). - Corrected unidentified message type to 'application/octet-stream'. - Fixed chunk_split() multibyte issue. - Added check for added attachments. ``` -------------------------------- ### PHPMailer 5.0.0 Documentation Release Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Comprehensive new documentation generated using PHPDocumentator (phpdocs) is available for PHPMailer version 5.0.0. ```APIDOC PHPMailer 5.0.0 Documentation: - Generated using PHPDocumentator (phpdocs) - Comprehensive and updated for version 5.0.0 ``` -------------------------------- ### PHPMailer Core Class Refactoring and Enhancements Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Details significant refactorings in `class.phpmailer.php`, including improved exception handling, removal of redundant functions, and new checks for PHP version compatibility and attachment duplication. These changes aim to enhance robustness and efficiency. ```APIDOC class.phpmailer.php: - Refactored with new exception handling - Sendmail/Qmail processing changed to prevent inadvertent use - getFile() function removed (was simple wrapper for file_get_contents()) - Added PHP version check (requires PHP 5.0+) - Enhanced attachment/inline graphic source checking to eliminate duplicates ``` -------------------------------- ### Add GetSentMIMEMessage() Method Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md A new method, `GetSentMIMEMessage()`, was introduced to allow retrieval of a full copy of the sent MIME message, constructing it only when needed to save memory. ```APIDOC PHPMailer::GetSentMIMEMessage(): returns full copy of sent message ``` -------------------------------- ### Introduce New Properties for DKIM Digital Signing Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md PHPMailer now supports DKIM digital signing with the addition of several new properties to configure the domain, private key, passphrase, selector, and identity for signing emails. ```APIDOC PHPMailer properties for DKIM: - DKIM_domain: string (sets the domain name) - DKIM_private: string (holds DKIM private key) - DKIM_passphrase: string (holds your DKIM passphrase) - DKIM_selector: string (holds the DKIM "selector") - DKIM_identity: string (holds the identifying email address) ``` -------------------------------- ### PHPMailer 2.2.1 Bug Fixes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Version 2.2.1 addresses a specific bug in `class.smtp.php` at line 1092. ```APIDOC PHPMailer 2.2.1 Bug Fix: - Fixed error on line 1092 in class.smtp.php ``` -------------------------------- ### Add Auto Identity Functionality with SetFrom Disabling Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Automatic identity functionality was introduced to automatically set `Return-path` and `Reply-To` headers if they are not explicitly defined, which helps in preventing emails from being flagged as spam. This feature can be disabled by passing `false` as the third parameter to the `SetFrom` method. ```APIDOC PHPMailer Auto Identity: - Automatically sets Return-path (if Sender not set) - Automatically sets Reply-To (if ReplyTo not set) ``` ```PHP $mail->SetFrom('yourname@yourdomain.com','First Last',false); ``` -------------------------------- ### PHPMailer 2.3 API and Internal Changes Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md Version 2.3 introduces language handling improvements, corrects various internal variable names and declarations, and updates default line endings for RFC compliance. It also includes specific bug fixes and removes outdated test and documentation files. ```APIDOC PHPMailer 2.3 API/Internal Changes: - Language Support: - Added Arabic language. - English language made default within class.phpmailer.php (removed from language files). - Code Corrections: - Fixed public/private declarations. - Corrected variable name: $basedir to $directory (line 1728). - Added $sign_cert_file to prevent $sign_key_file duplication. - Corrected method call: $this->Hello to $this->Helo (line 612). - Fixed phpunit.php for PHP5 compliance. - Configuration/Behavior Changes: - Default $LE (Line Ending) changed to "\r\n" (RFC 2822 compliance). User configurable. - Removed trim() from EncodeQP return results. - AltBody assignment updated: $this->AltBody = html_entity_decode($textMsg); - Removals: - /test directory and its files removed. - /phpdoc directory removed (documentation now online). ``` -------------------------------- ### Enable VERP in PHPMailer SMTP Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md This PHP snippet demonstrates how to activate Variable Envelope Return Path (VERP) functionality within PHPMailer. By setting the `do_verp` property to `true` on the mailer object, PHPMailer will generate unique return paths for each recipient, which is useful for bounce handling. This feature requires the `class.smtp.php` to be instantiated. ```PHP $mail->do_verp = true; ``` -------------------------------- ### Update ValidateAddress() Method to Public Static Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md The `ValidateAddress()` method was refactored to be `public static`, enabling developers to override the default validation scheme with their own. This update also removes its dependency on the `FILTER_VALIDATE_EMAIL` constant, which was deemed broken. ```APIDOC PHPMailer::ValidateAddress(): - Changed to public static method - No longer uses FILTER_VALIDATE_EMAIL ``` -------------------------------- ### Remove Deprecated Functions from class.smtp.php Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md As part of the refactoring to a fully object-oriented codebase, several unnecessary functions were removed from `class.smtp.php`, contributing to a reduction in code size and improved maintainability. ```APIDOC Removed functions from class.smtp.php: - public function Expand($name) - public function Help($keyword="") - public function Noop() - public function Send($from) - public function SendOrMail($from) - public function Verify($name) ``` -------------------------------- ### PHPMailer 2.1 E_STRICT Compatibility and Timezone Configuration Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/changelog.md PHPMailer 2.1 is fully E_STRICT compatible. To avoid date() function errors in PHP5, users must configure the 'date.timezone' directive in php.ini or set it programmatically. ```PHP // In php.ini: date.timezone = Etc/UTC // Or in your PHP script: date_default_timezone_set('Etc/UTC'); ``` -------------------------------- ### Set PHPMailer Language for Error Messages Source: https://github.com/tolizhan/oframe/blob/master/include/application/PHPMailer/README.md This snippet shows how to change the language of PHPMailer's error messages. It specifies the desired language code (e.g., 'fr' for French) and an optional path to the language directory. ```php // To load the French version $mail->setLanguage('fr', '/optional/path/to/language/directory/'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.