Really, it's much easier to use Composer! A Simple Example If you're using XOAUTH2 you will need src/OAuth.php as well as the Composer dependencies for the services you wish to authenticate with. You can skip the language folder if you're not showing errors to users and can make do with English-only errors. If you're using SMTP, you'll need src/SMTP.php, and if you're using POP-before SMTP ( very unlikely!), you'll need src/POP3.php. At the very least you will need src/PHPMailer.php. While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. This has several important effects – read the upgrade guide for more details. The biggest changes are that source files are now in the src/ folder, and PHPMailer now declares the namespace PHPMailer\PHPMailer. If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases. You will find the latest version of 5.2 in the 5.2-stable branch. PHPMailer 5.2 (which is compatible with PHP 5.0 - 7.0) is no longer supported, even for security updates. Even if you're not using exceptions, you do still need to load the Exception class as it is used internally. If you're not using the SMTP class explicitly (you're probably not), you don't need a use line for the SMTP class. Require 'path/to/PHPMailer/src/SMTP.php' Require 'path/to/PHPMailer/src/PHPMailer.php' Require 'path/to/PHPMailer/src/Exception.php'
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |