From 478ab816d947e35b285185379ed5c7d07c6bc327 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Thu, 6 Jul 2017 11:20:32 +0000 Subject: [PATCH] fixed FS#170: Update PHPMailer to 5.2.23, removed old con class phpmailer, added new external class to autoload --- .../docs/Callback_function_notes.txt | 17 - .../PHPMailer/docs/DomainKeys_notes.txt | 55 -- .../docs/Note_for_SMTP_debugging.txt | 23 - .../external/PHPMailer/docs/extending.html | 148 ---- conlite/external/PHPMailer/docs/faq.html | 67 -- .../external/PHPMailer/docs/pop3_article.txt | 39 - conlite/external/PHPMailer/docs/use_gmail.txt | 45 -- conlite/external/PHPMailer/test/contents.html | 10 - .../external/PHPMailer/test/phpmailerTest.php | 670 ------------------ conlite/external/PHPMailer/test/test.png | Bin 1280 -> 0 bytes .../external/PHPMailer/test/test_callback.php | 84 --- conlite/external/PHPMailer/test/testemail.php | 48 -- 12 files changed, 1206 deletions(-) delete mode 100644 conlite/external/PHPMailer/docs/Callback_function_notes.txt delete mode 100644 conlite/external/PHPMailer/docs/DomainKeys_notes.txt delete mode 100644 conlite/external/PHPMailer/docs/Note_for_SMTP_debugging.txt delete mode 100644 conlite/external/PHPMailer/docs/extending.html delete mode 100644 conlite/external/PHPMailer/docs/faq.html delete mode 100644 conlite/external/PHPMailer/docs/pop3_article.txt delete mode 100644 conlite/external/PHPMailer/docs/use_gmail.txt delete mode 100644 conlite/external/PHPMailer/test/contents.html delete mode 100644 conlite/external/PHPMailer/test/phpmailerTest.php delete mode 100644 conlite/external/PHPMailer/test/test.png delete mode 100644 conlite/external/PHPMailer/test/test_callback.php delete mode 100644 conlite/external/PHPMailer/test/testemail.php diff --git a/conlite/external/PHPMailer/docs/Callback_function_notes.txt b/conlite/external/PHPMailer/docs/Callback_function_notes.txt deleted file mode 100644 index 461ea50..0000000 --- a/conlite/external/PHPMailer/docs/Callback_function_notes.txt +++ /dev/null @@ -1,17 +0,0 @@ -NEW CALLBACK FUNCTION: -====================== - -We have had requests for a method to process the results of sending emails -through PHPMailer. In this new release, we have implemented a callback -function that passes the results of each email sent (to, cc, and/or bcc). -We have provided an example that echos the results back to the screen. The -callback function can be used for any purpose. With minor modifications, the -callback function can be used to create CSV logs, post results to databases, -etc. - -Please review the test.php script for the example. - -It's pretty straight forward. - -Enjoy! -Andy diff --git a/conlite/external/PHPMailer/docs/DomainKeys_notes.txt b/conlite/external/PHPMailer/docs/DomainKeys_notes.txt deleted file mode 100644 index 2ad10f1..0000000 --- a/conlite/external/PHPMailer/docs/DomainKeys_notes.txt +++ /dev/null @@ -1,55 +0,0 @@ -CREATE DKIM KEYS and DNS Resource Record: -========================================= - -To create DomainKeys Identified Mail keys, visit: -http://dkim.worxware.com/ -... read the information, fill in the form, and download the ZIP file -containing the public key, private key, DNS Resource Record and instructions -to add to your DNS Zone Record, and the PHPMailer code to enable DKIM -digital signing. - -/*** PROTECT YOUR PRIVATE & PUBLIC KEYS ***/ - -You need to protect your DKIM private and public keys from being viewed or -accessed. Add protection to your .htaccess file as in this example: - -# secure htkeyprivate file - - order allow,deny - deny from all - - -# secure htkeypublic file - - order allow,deny - deny from all - - -(the actual .htaccess additions are in the ZIP file sent back to you from -http://dkim.worxware.com/ - -A few notes on using DomainKey Identified Mail (DKIM): - -You do not need to use PHPMailer to DKIM sign emails IF: -- you enable DomainKey support and add the DNS resource record -- you use your outbound mail server - -If you are a third-party emailer that works on behalf of domain owners to -send their emails from your own server: -- you absolutely have to DKIM sign outbound emails -- the domain owner has to add the DNS resource record to match the - private key, public key, selector, identity, and domain that you create -- use caution with the "selector" ... at least one "selector" will already - exist in the DNS Zone Record of the domain at the domain owner's server - you need to ensure that the "selector" you use is unique -Note: since the IP address will not match the domain owner's DNS Zone record -you can be certain that email providers that validate based on DomainKey will -check the domain owner's DNS Zone record for your DNS resource record. Before -sending out emails on behalf of domain owners, ensure they have entered the -DNS resource record you provided them. - -Enjoy! -Andy - -PS. if you need additional information about DKIM, please see: -http://www.dkim.org/info/dkim-faq.html diff --git a/conlite/external/PHPMailer/docs/Note_for_SMTP_debugging.txt b/conlite/external/PHPMailer/docs/Note_for_SMTP_debugging.txt deleted file mode 100644 index afb5b58..0000000 --- a/conlite/external/PHPMailer/docs/Note_for_SMTP_debugging.txt +++ /dev/null @@ -1,23 +0,0 @@ -If you are having problems connecting or sending emails through your SMTP server, please note: - -1. The new rewrite of class.smtp.php provides more information about the processing/errors taking place -2. Use the debug functionality of class.smtp.php. To do that, in your own script add the debug level you wish to use. An example of that is: - -$mail->SMTPDebug = 1; -$mail->IsSMTP(); // telling the class to use SMTP -$mail->SMTPAuth = true; // enable SMTP authentication -$mail->Port = 26; // set the SMTP port -$mail->Host = "mail.yourhost.com"; // SMTP server -$mail->Username = "name@yourhost.com"; // SMTP account username -$mail->Password = "your password"; // SMTP account password - -Notes on this: -$mail->SMTPDebug = 0; ... will disable debugging (you can also leave this out completely, 0 is the default -$mail->SMTPDebug = 1; ... will echo errors and messages -$mail->SMTPDebug = 2; ... will echo messages only -... and finally, the options are 0, 1, and 2 ... any number greater than 2 will be interpreted as 2 - -And finally, don't forget to disable debugging before going into production. - -Enjoy! -Andy \ No newline at end of file diff --git a/conlite/external/PHPMailer/docs/extending.html b/conlite/external/PHPMailer/docs/extending.html deleted file mode 100644 index 310f97a..0000000 --- a/conlite/external/PHPMailer/docs/extending.html +++ /dev/null @@ -1,148 +0,0 @@ - - -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/conlite/external/PHPMailer/docs/faq.html b/conlite/external/PHPMailer/docs/faq.html deleted file mode 100644 index f71c6c8..0000000 --- a/conlite/external/PHPMailer/docs/faq.html +++ /dev/null @@ -1,67 +0,0 @@ - - -PHPMailer FAQ - - - -
-
-

PHPMailer FAQ

- - -
-
- - - diff --git a/conlite/external/PHPMailer/docs/pop3_article.txt b/conlite/external/PHPMailer/docs/pop3_article.txt deleted file mode 100644 index cc54f7c..0000000 --- a/conlite/external/PHPMailer/docs/pop3_article.txt +++ /dev/null @@ -1,39 +0,0 @@ -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/conlite/external/PHPMailer/docs/use_gmail.txt b/conlite/external/PHPMailer/docs/use_gmail.txt deleted file mode 100644 index 7519d7d..0000000 --- a/conlite/external/PHPMailer/docs/use_gmail.txt +++ /dev/null @@ -1,45 +0,0 @@ -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/conlite/external/PHPMailer/test/contents.html b/conlite/external/PHPMailer/test/contents.html deleted file mode 100644 index dbb8bfe..0000000 --- a/conlite/external/PHPMailer/test/contents.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Email test - - - -

Here is a test HTML email

- - diff --git a/conlite/external/PHPMailer/test/phpmailerTest.php b/conlite/external/PHPMailer/test/phpmailerTest.php deleted file mode 100644 index 012c6f6..0000000 --- a/conlite/external/PHPMailer/test/phpmailerTest.php +++ /dev/null @@ -1,670 +0,0 @@ -Mail = new PHPMailer(); - - $this->Mail->Priority = 3; - $this->Mail->Encoding = "8bit"; - $this->Mail->CharSet = "iso-8859-1"; - if (array_key_exists('mail_from', $_REQUEST)) { - $this->Mail->From = $_REQUEST['mail_from']; - } else { - $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; - if (array_key_exists('mail_host', $_REQUEST)) { - $this->Mail->Host = $_REQUEST['mail_host']; - } else { - $this->Mail->Host = 'mail.example.com'; - } - $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"; - } - - if (array_key_exists('mail_to', $_REQUEST)) { - $this->SetAddress($_REQUEST['mail_to'], 'Test User', 'to'); - } - if (array_key_exists('mail_cc', $_REQUEST) and strlen($_REQUEST['mail_cc']) > 0) { - $this->SetAddress($_REQUEST['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 = ""; - } - else - { - $eol = "\n"; - $bullet = " - "; - $bullet_start = ""; - $bullet_end = ""; - } - - $ReportBody = ""; - - $ReportBody .= "---------------------" . $eol; - $ReportBody .= "Unit Test Information" . $eol; - $ReportBody .= "---------------------" . $eol; - $ReportBody .= "phpmailer version: " . PHPMailer::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 - $attachments = $this->Mail->GetAttachments(); - if(count($attachments) > 0) - { - $ReportBody .= "Attachments:" . $eol; - $ReportBody .= $bullet_start; - foreach($attachments as $attachment) { - $ReportBody .= $bullet . "Name: " . $attachment[1] . ", "; - $ReportBody .= "Encoding: " . $attachment[3] . ", "; - $ReportBody .= "Type: " . $attachment[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": - return $this->Mail->AddAddress($sAddress, $sName); - case "cc": - return $this->Mail->AddCC($sAddress, $sName); - case "bcc": - return $this->Mail->AddBCC($sAddress, $sName); - } - } - - ///////////////////////////////////////////////// - // 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->assertTrue($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->assertTrue($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->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - if(!$this->Mail->AddAttachment(__FILE__, "test.txt")) - { - $this->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - $this->BuildBody(); - $this->assertTrue($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->assertTrue($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->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - - //Check that a quoted printable encode and decode results in the same as went in - $t = substr(file_get_contents(__FILE__), 0, 1024); //Just pick a chunk of this file as test content - $this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQP($t)), 'QP encoding round-trip failed'); - //$this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQPphp($t)), 'Native PHP QP encoding round-trip failed'); //TODO the PHP qp encoder is quite broken - - } - - /** - * 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->assertTrue($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(__FILE__, "test_attach.txt")) - { - $this->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - $this->BuildBody(); - $this->assertTrue($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->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - $this->BuildBody(); - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - //For code coverage - $this->Mail->AddEmbeddedImage('thisfiledoesntexist', 'xyz'); //Non-existent file - $this->Mail->AddEmbeddedImage(__FILE__, '123'); //Missing name - - } - - /** - * 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->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - if(!$this->Mail->AddAttachment(__FILE__, "test.txt")) - { - $this->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - $this->BuildBody(); - $this->assertTrue($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->assertTrue($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(__FILE__, "test_attach.txt")) - { - $this->assertTrue(false, $this->Mail->ErrorInfo); - return; - } - - $this->BuildBody(); - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - if (is_writable('.')) { - file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody()); - } else { - $this->assertTrue(false, 'Could not write local file - check permissions'); - } - } - - function test_MultipleSend() { - $this->Mail->Body = "Sending two messages without keepalive"; - $this->BuildBody(); - $subject = $this->Mail->Subject; - - $this->Mail->Subject = $subject . ": SMTP 1"; - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - - $this->Mail->Subject = $subject . ": SMTP 2"; - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - } - - function test_SendmailSend() { - $this->Mail->Body = "Sending via sendmail"; - $this->BuildBody(); - $subject = $this->Mail->Subject; - - $this->Mail->Subject = $subject . ": sendmail"; - $this->Mail->IsSendmail(); - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - } - - function test_MailSend() { - $this->Mail->Body = "Sending via mail()"; - $this->BuildBody(); - $subject = $this->Mail->Subject; - - $this->Mail->Subject = $subject . ": mail()"; - $this->Mail->IsMail(); - $this->assertTrue($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->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); - - $this->Mail->Subject = $subject . ": SMTP keep-alive 2"; - $this->assertTrue($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->assertTrue($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->assertTrue($this->Mail->IsError() == false, "Error found"); - $this->assertTrue($this->Mail->Send() == false, "Send succeeded"); - $this->assertTrue($this->Mail->IsError(), "No error found"); - $this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo); - $this->Mail->AddAddress($_REQUEST['mail_to']); - $this->assertTrue($this->Mail->Send(), "Send failed"); - } - - function test_Addressing() { - $this->assertFalse($this->Mail->AddAddress('a@example..com'), 'Invalid address accepted'); - $this->assertTrue($this->Mail->AddAddress('a@example.com'), 'Addressing failed'); - $this->assertFalse($this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed'); - $this->assertTrue($this->Mail->AddCC('b@example.com'), 'CC addressing failed'); - $this->assertFalse($this->Mail->AddCC('b@example.com'), 'CC duplicate addressing failed'); - $this->assertFalse($this->Mail->AddCC('a@example.com'), 'CC duplicate addressing failed (2)'); - $this->assertTrue($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed'); - $this->assertFalse($this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed'); - $this->assertFalse($this->Mail->AddBCC('a@example.com'), 'BCC duplicate addressing failed (2)'); - $this->assertTrue($this->Mail->AddReplyTo('a@example.com'), 'Replyto Addressing failed'); - $this->assertFalse($this->Mail->AddReplyTo('a@example..com'), 'Invalid Replyto address accepted'); - $this->Mail->ClearAddresses(); - $this->Mail->ClearCCs(); - $this->Mail->ClearBCCs(); - $this->Mail->ClearReplyTos(); - } - - /** - * Test language files for missing and excess translations - * All languages are compared with English - */ - function test_Translations() { - $this->Mail->SetLanguage('en'); - $definedStrings = $this->Mail->GetTranslations(); - foreach (new DirectoryIterator('../language') as $fileInfo) { - if($fileInfo->isDot()) continue; - $matches = array(); - //Only look at language files, ignore anything else in there - if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) { - $lang = $matches[1]; //Extract language code - $PHPMAILER_LANG = array(); //Language strings get put in here - include $fileInfo->getPathname(); //Get language strings - $missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG)); - $extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings)); - $this->assertTrue(empty($missing), "Missing translations in $lang: ". implode(', ', $missing)); - $this->assertTrue(empty($extra), "Extra translations in $lang: ". implode(', ', $extra)); - } - } - } - - /** - * Encoding tests - */ - function test_Encodings() { - $this->Mail->Charset = 'iso-8859-1'; - $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'text'), 'Q Encoding (text) failed'); - $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'comment'), 'Q Encoding (comment) failed'); - $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'phrase'), 'Q Encoding (phrase) failed'); - } - - /** - * Signing tests - */ - function test_Signing() { - $this->Mail->Sign('certfile.txt', 'keyfile.txt', 'password'); //TODO this is not really testing signing, but at least helps coverage - } - - /** - * Miscellaneous calls to improve test coverage and some small tests - */ - function test_Miscellaneous() { - $this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf') , 'MIME TYPE lookup failed'); - $this->Mail->AddCustomHeader('SomeHeader: Some Value'); - $this->Mail->ClearCustomHeaders(); - $this->Mail->ClearAttachments(); - $this->Mail->IsHTML(false); - $this->Mail->IsSMTP(); - $this->Mail->IsMail(); - $this->Mail->IsSendMail(); - $this->Mail->IsQmail(); - $this->Mail->SetLanguage('fr'); - $this->Mail->Sender = ''; - $this->Mail->CreateHeader(); - $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded'); - $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed'); - $this->Mail->getFile(__FILE__); - } -} - -/** -* This is a sample form for setting appropriate test values through a browser -* These values can also be set using a file called testbootstrap.php (not in svn) in the same folder as this script -* which is probably more useful if you run these tests a lot - - -

    phpmailer Unit Test

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

    - - -

    - - - */ - -?> \ No newline at end of file diff --git a/conlite/external/PHPMailer/test/test.png b/conlite/external/PHPMailer/test/test.png deleted file mode 100644 index 02de5a7aa3507dcec1e4349520ba3e8d8f7da4d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1280 zcmeAS@N?(olHy`uVBq!ia0vp^tw5~K!2~4N<;e5_DVB6cUq=Rpjs4tz5?O(Kwj^(N z7lt)J7K6`}lP`c2XMsm#F#`j)5C}6~x?A@LD9B#o>FdgViCLDPN5AUi^*W$IwVp1H zAr*7p&f1@M+e+k^|GQka$^gd77pzXAva3|tw#@qU#D{GY+ZFCDwG1cEE579X#FX@$ z>FgwH&r=2B{84unZkVCiZ2N-g>I8;;hdm>XmCd=c^yvZlCI_MawKnqnCmAdw)?ZJ! z(AIo@e{`ec)BgLq2R?8-ZjY0&|8nTZLh)n#dkyMdw0?Bf?~$)c{BwaDo7B9IhZmN_ zh%E0uYH;3Pyt^=vfg$lt&fag6k0_-)7M*|G)$q*c&0lYID|HLld!D2e%F$=%SRuTY%I{2>Z{`vAZ>PV)}|}nN;w+U!QCIM z%dF3Q&h>n}=zwNb};ib(x>mdBz9tFM3#&2Z?-_RqK4ZYm+e055CrlA)a-UVpFR%v^PFVTssrYu_S`qZP4zZaccRhpt_9sylhjwpf+< z?Unnqytf|Oq_caOTOat-{V}jySM+ZLcry9!jFnfUInkZcQYhKM%L?N z&;!?rRVNa)m=6Fgxg2tDuEA9ET|#r_i?D{h*tzce28%w4!-tRgPZEBrw|%nx;k`%s zmfAYKyY+2b?$bqXn&r8-ISa3Ed-Xbga%WV_rQePT^77kD|K`Wu-}?6KQP#RWxwn}c zwyiVVWYOa4alSPF_O^E6V7L1351I46v}`n=eDeF}VulLinF~}7&9IfYQ}efLn#`@T z=<5}~4|Vgtn(q9aBQi8J`g;4eTzYtu=Z+lD zh7)#nVsqqgZL{jmKBw#CAyMYrd^hQ7_PL8!4qsoNfBW0BM@jw%&i;>o+4}Q$48E+4 clFJ|2pD+7py#+`y85}Sb4q9e08zkVlmGw# diff --git a/conlite/external/PHPMailer/test/test_callback.php b/conlite/external/PHPMailer/test/test_callback.php deleted file mode 100644 index 260a448..0000000 --- a/conlite/external/PHPMailer/test/test_callback.php +++ /dev/null @@ -1,84 +0,0 @@ - - -PHPMailer Lite - DKIM and Callback Function test - - - -\n"; - return true; -} - -$testLite = false; - -if ($testLite) { - require_once '../class.phpmailer-lite.php'; - $mail = new PHPMailerLite(); -} else { - require_once '../class.phpmailer.php'; - $mail = new PHPMailer(); -} - -try { - $mail->IsMail(); // telling the class to use SMTP - $mail->SetFrom('you@yourdomain.com', 'Your Name'); - $mail->AddAddress('another@yourdomain.com', 'John Doe'); - $mail->Subject = 'PHPMailer Lite Test Subject via Mail()'; - $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically - $mail->MsgHTML(file_get_contents('contents.html')); - $mail->AddAttachment('images/phpmailer.gif'); // attachment - $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment - $mail->action_function = 'callbackAction'; - $mail->Send(); - echo "Message Sent OK

    \n"; -} catch (phpmailerException $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} - -function cleanEmails($str,$type) { - if ($type == 'cc') { - $addy['Email'] = $str[0]; - $addy['Name'] = $str[1]; - return $addy; - } - if (!strstr($str, ' <')) { - $addy['Name'] = ''; - $addy['Email'] = $addy; - return $addy; - } - $addyArr = explode(' <', $str); - if (substr($addyArr[1],-1) == '>') { - $addyArr[1] = substr($addyArr[1],0,-1); - } - $addy['Name'] = $addyArr[0]; - $addy['Email'] = $addyArr[1]; - $addy['Email'] = str_replace('@', '@', $addy['Email']); - return $addy; -} - -?> - - diff --git a/conlite/external/PHPMailer/test/testemail.php b/conlite/external/PHPMailer/test/testemail.php deleted file mode 100644 index c4070df..0000000 --- a/conlite/external/PHPMailer/test/testemail.php +++ /dev/null @@ -1,48 +0,0 @@ -IsSMTP(); // tell the class to use SMTP - $mail->SMTPAuth = true; // enable SMTP authentication - $mail->Port = 25; // set the SMTP server port - $mail->Host = "mail.yourdomain.com"; // SMTP server - $mail->Username = "name@domain.com"; // SMTP server username - $mail->Password = "password"; // SMTP server password - - $mail->IsSendmail(); // tell the class to use Sendmail - - $mail->AddReplyTo("name@domain.com","First Last"); - - $mail->From = "name@domain.com"; - $mail->FromName = "First Last"; - - $to = "someone@example...com"; - - $mail->AddAddress($to); - - $mail->Subject = "First PHPMailer Message"; - - $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test - $mail->WordWrap = 80; // set word wrap - - $mail->MsgHTML($body); - - $mail->IsHTML(true); // send as HTML - - $mail->Send(); - echo 'Message has been sent.'; -} catch (phpmailerException $e) { - echo $e->errorMessage(); -} -?> \ No newline at end of file