diff --git a/plugin/PHPMailer_v2.0.4/ChangeLog.txt b/plugin/PHPMailer_v2.0.4/ChangeLog.txt new file mode 100644 index 000000000..172a85eac --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/ChangeLog.txt @@ -0,0 +1,302 @@ +ChangeLog + +Version 2.0.4 (April 02 2009) +* fixed == in class.smtp.php +- NOTE: this is it folks, our last PHPMailer to support PHP4 + +Version 2.0.3 (November 08 2008) +* fixed line 1041 in class.smtp.php (endless loop from missing = sign) +* fixed duplicate images in email body +* removed English language from language files and made it a default within + class.phpmailer.php - if no language is found, it will default to use + the english language translation +* corrected $basedir to $directory +* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user + if default is not acceptable +* removed trim() from return results in EncodeQP +* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); +* We have removed the /phpdoc from the downloads. All documentation is now on + the http://phpmailer.codeworxtech.com website. + +Version 2.0.2 (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. +* 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.0.1 (Sun, Dec 02 2007) +* corrected incorrect version numbers in all three classes + +Version 2.0.0 (Sun, Dec 02 2007) +* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) +* finished all testing, all known bugs corrected, enhancements tested +- note: designed for PHP4, but will work with PHP5 (not compatible with + E_STRICT) ... full PHP5 version of PHPMailer released separately. + PHP5 version will NOT work with PHP4. + +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/plugin/PHPMailer_v2.0.4/LICENSE b/plugin/PHPMailer_v2.0.4/LICENSE new file mode 100644 index 000000000..03851a338 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/plugin/PHPMailer_v2.0.4/README b/plugin/PHPMailer_v2.0.4/README new file mode 100644 index 000000000..ad988dc9b --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/README @@ -0,0 +1,174 @@ +/******************************************************************* +* 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.0.4 (April 02, 2009) + +This is the last version to support PHP4. We've made the move to PHP5 and +all of our efforts now are into PHPMailer for PHP5/6. + +Version 2.0.3 (November 08, 2008) + +PHP4 continues to be a major platform for developers. We are responding +to the emails received to continue development for PHP4 with this +release. + +We have removed the /phpdoc from the downloads. All documentation is now on +the http://phpmailer.codeworxtech.com website. + +For all other changes and notes, please see the changelog. + +Donations are accepted at PayPal with our id "paypal@worxteam.com". + +Version 2.2 (July 15 2008) + +- see the changelog. + +Version 2.0.2 (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 sourceforge.net Tracker. + +** 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. + +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! + +** 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/projects/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 Ive 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/plugin/PHPMailer_v2.0.4/class.phpmailer.php b/plugin/PHPMailer_v2.0.4/class.phpmailer.php new file mode 100644 index 000000000..a943219c1 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/class.phpmailer.php @@ -0,0 +1,1911 @@ +ContentType = 'text/html'; + } else { + $this->ContentType = 'text/plain'; + } + } + + /** + * Sets Mailer to send message using SMTP. + * @return void + */ + function IsSMTP() { + $this->Mailer = 'smtp'; + } + + /** + * Sets Mailer to send message using PHP mail() function. + * @return void + */ + function IsMail() { + $this->Mailer = 'mail'; + } + + /** + * Sets Mailer to send message using the $Sendmail program. + * @return void + */ + function IsSendmail() { + $this->Mailer = 'sendmail'; + } + + /** + * Sets Mailer to send message using the qmail MTA. + * @return void + */ + function IsQmail() { + $this->Sendmail = '/var/qmail/bin/sendmail'; + $this->Mailer = 'sendmail'; + } + + ///////////////////////////////////////////////// + // METHODS, RECIPIENTS + ///////////////////////////////////////////////// + + /** + * Adds a "To" address. + * @param string $address + * @param string $name + * @return void + */ + function AddAddress($address, $name = '') { + $cur = count($this->to); + $this->to[$cur][0] = trim($address); + $this->to[$cur][1] = $name; + } + + /** + * Adds a "Cc" address. Note: this function works + * with the SMTP mailer on win32, not with the "mail" + * mailer. + * @param string $address + * @param string $name + * @return void + */ + function AddCC($address, $name = '') { + $cur = count($this->cc); + $this->cc[$cur][0] = trim($address); + $this->cc[$cur][1] = $name; + } + + /** + * Adds a "Bcc" address. Note: this function works + * with the SMTP mailer on win32, not with the "mail" + * mailer. + * @param string $address + * @param string $name + * @return void + */ + function AddBCC($address, $name = '') { + $cur = count($this->bcc); + $this->bcc[$cur][0] = trim($address); + $this->bcc[$cur][1] = $name; + } + + /** + * Adds a "Reply-To" address. + * @param string $address + * @param string $name + * @return void + */ + function AddReplyTo($address, $name = '') { + $cur = count($this->ReplyTo); + $this->ReplyTo[$cur][0] = trim($address); + $this->ReplyTo[$cur][1] = $name; + } + + ///////////////////////////////////////////////// + // METHODS, MAIL SENDING + ///////////////////////////////////////////////// + + /** + * 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. + * @return bool + */ + function Send() { + $header = ''; + $body = ''; + $result = true; + + if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { + $this->SetError($this->Lang('provide_address')); + return false; + } + + /* Set whether the message is multipart/alternative */ + if(!empty($this->AltBody)) { + $this->ContentType = 'multipart/alternative'; + } + + $this->error_count = 0; // reset errors + $this->SetMessageType(); + $header .= $this->CreateHeader(); + $body = $this->CreateBody(); + + if($body == '') { + return false; + } + + /* Choose the mailer */ + switch($this->Mailer) { + case 'sendmail': + $result = $this->SendmailSend($header, $body); + break; + case 'smtp': + $result = $this->SmtpSend($header, $body); + break; + case 'mail': + $result = $this->MailSend($header, $body); + break; + default: + $result = $this->MailSend($header, $body); + break; + //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported')); + //$result = false; + //break; + } + + return $result; + } + + /** + * Sends mail using the $Sendmail program. + * @access private + * @return bool + */ + function SendmailSend($header, $body) { + if ($this->Sender != '') { + $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } else { + $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); + } + + if(!@$mail = popen($sendmail, 'w')) { + $this->SetError($this->Lang('execute') . $this->Sendmail); + return false; + } + + fputs($mail, $header); + fputs($mail, $body); + + $result = pclose($mail); + if (version_compare(phpversion(), '4.2.3') == -1) { + $result = $result >> 8 & 0xFF; + } + if($result != 0) { + $this->SetError($this->Lang('execute') . $this->Sendmail); + return false; + } + return true; + } + + /** + * Sends mail using the PHP mail() function. + * @access private + * @return bool + */ + function MailSend($header, $body) { + + $to = ''; + for($i = 0; $i < count($this->to); $i++) { + if($i != 0) { $to .= ', '; } + $to .= $this->AddrFormat($this->to[$i]); + } + + //$toArr = split(',', $to); + $toArr = explode(',', $to); + + $params = sprintf("-oi -f %s", $this->Sender); + if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) { + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $key => $val) { + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $key => $val) { + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); + } + } + + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + + if(!$rt) { + $this->SetError($this->Lang('instantiate')); + return false; + } + + return true; + } + + /** + * Sends mail via SMTP using PhpSMTP (Author: + * Chris Ryan). Returns bool. Returns false if there is a + * bad MAIL FROM, RCPT, or DATA input. + * @access private + * @return bool + */ + function SmtpSend($header, $body) { + include_once($this->PluginDir . 'class.smtp.php'); + $error = ''; + $bad_rcpt = array(); + + if(!$this->SmtpConnect()) { + return false; + } + + $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; + if(!$this->smtp->Mail($smtp_from)) { + $error = $this->Lang('from_failed') . $smtp_from; + $this->SetError($error); + $this->smtp->Reset(); + return false; + } + + /* Attempt to send attach all recipients */ + for($i = 0; $i < count($this->to); $i++) { + if(!$this->smtp->Recipient($this->to[$i][0])) { + $bad_rcpt[] = $this->to[$i][0]; + } + } + for($i = 0; $i < count($this->cc); $i++) { + if(!$this->smtp->Recipient($this->cc[$i][0])) { + $bad_rcpt[] = $this->cc[$i][0]; + } + } + for($i = 0; $i < count($this->bcc); $i++) { + if(!$this->smtp->Recipient($this->bcc[$i][0])) { + $bad_rcpt[] = $this->bcc[$i][0]; + } + } + + if(count($bad_rcpt) > 0) { // Create error message + for($i = 0; $i < count($bad_rcpt); $i++) { + if($i != 0) { + $error .= ', '; + } + $error .= $bad_rcpt[$i]; + } + $error = $this->Lang('recipients_failed') . $error; + $this->SetError($error); + $this->smtp->Reset(); + return false; + } + + if(!$this->smtp->Data($header . $body)) { + $this->SetError($this->Lang('data_not_accepted')); + $this->smtp->Reset(); + return false; + } + if($this->SMTPKeepAlive == true) { + $this->smtp->Reset(); + } else { + $this->SmtpClose(); + } + + return true; + } + + /** + * Initiates a connection to an SMTP server. Returns false if the + * operation failed. + * @access private + * @return bool + */ + function SmtpConnect() { + if($this->smtp == NULL) { + $this->smtp = new SMTP(); + } + + $this->smtp->do_debug = $this->SMTPDebug; + $hosts = explode(';', $this->Host); + $index = 0; + $connection = ($this->smtp->Connected()); + + /* Retry while there is no connection */ + while($index < count($hosts) && $connection == false) { + $hostinfo = array(); + if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) { + $host = $hostinfo[1]; + $port = $hostinfo[2]; + } else { + $host = $hosts[$index]; + $port = $this->Port; + } + + if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) { + if ($this->Helo != '') { + $this->smtp->Hello($this->Helo); + } else { + $this->smtp->Hello($this->ServerHostname()); + } + + $connection = true; + if($this->SMTPAuth) { + if(!$this->smtp->Authenticate($this->Username, $this->Password)) { + $this->SetError($this->Lang('authenticate')); + $this->smtp->Reset(); + $connection = false; + } + } + } + $index++; + } + if(!$connection) { + $this->SetError($this->Lang('connect_host')); + } + + return $connection; + } + + /** + * Closes the active SMTP session if one exists. + * @return void + */ + function SmtpClose() { + if($this->smtp != NULL) { + if($this->smtp->Connected()) { + $this->smtp->Quit(); + $this->smtp->Close(); + } + } + } + + /** + * Sets the language for all class error messages. Returns false + * if it cannot load the language file. The default language type + * is English. + * @param string $lang_type Type of language (e.g. Portuguese: "br") + * @param string $lang_path Path to the language file directory + * @access public + * @return bool + */ + function SetLanguage($lang_type, $lang_path = 'language/') { + if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) { + include($lang_path.'phpmailer.lang-'.$lang_type.'.php'); + } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) { + include($lang_path.'phpmailer.lang-en.php'); + } else { + $PHPMAILER_LANG = array(); + $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' . + $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.'; + $PHPMAILER_LANG["execute"] = 'Could not execute: '; + $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.'; + $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.'; + $PHPMAILER_LANG["from_failed"] = 'The following From address failed: '; + $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' . + $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.'; + $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.'; + $PHPMAILER_LANG["file_access"] = 'Could not access file: '; + $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: '; + $PHPMAILER_LANG["encoding"] = 'Unknown encoding: '; + $PHPMAILER_LANG["signing"] = 'Signing Error: '; + } + $this->language = $PHPMAILER_LANG; + + return true; + } + + ///////////////////////////////////////////////// + // METHODS, MESSAGE CREATION + ///////////////////////////////////////////////// + + /** + * Creates recipient headers. + * @access private + * @return string + */ + function AddrAppend($type, $addr) { + $addr_str = $type . ': '; + $addr_str .= $this->AddrFormat($addr[0]); + if(count($addr) > 1) { + for($i = 1; $i < count($addr); $i++) { + $addr_str .= ', ' . $this->AddrFormat($addr[$i]); + } + } + $addr_str .= $this->LE; + + return $addr_str; + } + + /** + * Formats an address correctly. + * @access private + * @return string + */ + function AddrFormat($addr) { + if(empty($addr[1])) { + $formatted = $this->SecureHeader($addr[0]); + } else { + $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; + } + + return $formatted; + } + + /** + * Wraps message for use with mailers that do not + * automatically perform wrapping and for quoted-printable. + * Original written by philippe. + * @access private + * @return string + */ + function WrapText($message, $length, $qp_mode = false) { + $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; + // If utf-8 encoding is used, we will need to make sure we don't + // split multibyte characters when we wrap + $is_utf8 = (strtolower($this->CharSet) == "utf-8"); + + $message = $this->FixEOL($message); + if (substr($message, -1) == $this->LE) { + $message = substr($message, 0, -1); + } + + $line = explode($this->LE, $message); + $message = ''; + for ($i=0 ;$i < count($line); $i++) { + $line_part = explode(' ', $line[$i]); + $buf = ''; + for ($e = 0; $e $length)) { + $space_left = $length - strlen($buf) - 1; + if ($e != 0) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->UTF8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == "=") { + $len--; + } elseif (substr($word, $len - 2, 1) == "=") { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf("=%s", $this->LE); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while (strlen($word) > 0) { + $len = $length; + if ($is_utf8) { + $len = $this->UTF8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == "=") { + $len--; + } elseif (substr($word, $len - 2, 1) == "=") { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + + if (strlen($word) > 0) { + $message .= $part . sprintf("=%s", $this->LE); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + $buf .= ($e == 0) ? $word : (' ' . $word); + + if (strlen($buf) > $length and $buf_o != '') { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + } + $message .= $buf . $this->LE; + } + + return $message; + } + + /** + * Finds last character boundary prior to maxLength in a utf-8 + * quoted (printable) encoded string. + * Original written by Colin Brown. + * @access private + * @param string $encodedText utf-8 QP text + * @param int $maxLength find last character boundary prior to this length + * @return int + */ + function UTF8CharBoundary($encodedText, $maxLength) { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, "="); + if ($encodedCharPos !== false) { + // Found start of encoded character byte within $lookBack block. + // Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { // Single byte character. + // If the encoded char was found at pos 0, it will fit + // otherwise reduce maxLength to start of the encoded char + $maxLength = ($encodedCharPos == 0) ? $maxLength : + $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec >= 192) { // First byte of a multi byte character + // Reduce maxLength to split at start of character + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + // No encoded character found + $foundSplitPos = true; + } + } + return $maxLength; + } + + /** + * Set the body wrapping. + * @access private + * @return void + */ + function SetWordWrap() { + if($this->WordWrap < 1) { + return; + } + + switch($this->message_type) { + case 'alt': + /* fall through */ + case 'alt_attachments': + $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->WrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assembles message header. + * @access private + * @return string + */ + function CreateHeader() { + $result = ''; + + /* Set the boundaries */ + $uniq_id = md5(uniqid(time())); + $this->boundary[1] = 'b1_' . $uniq_id; + $this->boundary[2] = 'b2_' . $uniq_id; + + $result .= $this->HeaderLine('Date', $this->RFCDate()); + if($this->Sender == '') { + $result .= $this->HeaderLine('Return-Path', trim($this->From)); + } else { + $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); + } + + /* To be created automatically by mail() */ + if($this->Mailer != 'mail') { + if(count($this->to) > 0) { + $result .= $this->AddrAppend('To', $this->to); + } elseif (count($this->cc) == 0) { + $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); + } + } + + $from = array(); + $from[0][0] = trim($this->From); + $from[0][1] = $this->FromName; + $result .= $this->AddrAppend('From', $from); + + /* sendmail and mail() extract Cc from the header before sending */ + if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) { + $result .= $this->AddrAppend('Cc', $this->cc); + } + + /* sendmail and mail() extract Bcc from the header before sending */ + if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { + $result .= $this->AddrAppend('Bcc', $this->bcc); + } + + if(count($this->ReplyTo) > 0) { + $result .= $this->AddrAppend('Reply-To', $this->ReplyTo); + } + + /* mail() sets the subject itself */ + if($this->Mailer != 'mail') { + $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); + } + + if($this->MessageID != '') { + $result .= $this->HeaderLine('Message-ID',$this->MessageID); + } else { + $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); + } + $result .= $this->HeaderLine('X-Priority', $this->Priority); + $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']'); + + if($this->ConfirmReadingTo != '') { + $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); + } + + // Add custom headers + for($index = 0; $index < count($this->CustomHeader); $index++) { + $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); + } + if (!$this->sign_key_file) { + $result .= $this->HeaderLine('MIME-Version', '1.0'); + $result .= $this->GetMailMIME(); + } + + return $result; + } + + /** + * Returns the message MIME. + * @access private + * @return string + */ + function GetMailMIME() { + $result = ''; + switch($this->message_type) { + case 'plain': + $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); + $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); + break; + case 'attachments': + /* fall through */ + case 'alt_attachments': + if($this->InlineImageExists()){ + $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE); + } else { + $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;'); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + } + break; + case 'alt': + $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + } + + if($this->Mailer != 'mail') { + $result .= $this->LE.$this->LE; + } + + return $result; + } + + /** + * Assembles the message body. Returns an empty string on failure. + * @access private + * @return string + */ + function CreateBody() { + $result = ''; + if ($this->sign_key_file) { + $result .= $this->GetMailMIME(); + } + + $this->SetWordWrap(); + + switch($this->message_type) { + case 'alt': + $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); + $result .= $this->EncodeString($this->AltBody, $this->Encoding); + $result .= $this->LE.$this->LE; + $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE.$this->LE; + $result .= $this->EndBoundary($this->boundary[1]); + break; + case 'plain': + $result .= $this->EncodeString($this->Body, $this->Encoding); + break; + case 'attachments': + $result .= $this->GetBoundary($this->boundary[1], '', '', ''); + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE; + $result .= $this->AttachAll(); + break; + case 'alt_attachments': + $result .= sprintf("--%s%s", $this->boundary[1], $this->LE); + $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); + $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body + $result .= $this->EncodeString($this->AltBody, $this->Encoding); + $result .= $this->LE.$this->LE; + $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE.$this->LE; + $result .= $this->EndBoundary($this->boundary[2]); + $result .= $this->AttachAll(); + break; + } + + if($this->IsError()) { + $result = ''; + } else if ($this->sign_key_file) { + $file = tempnam("", "mail"); + $fp = fopen($file, "w"); + fwrite($fp, $result); + fclose($fp); + $signed = tempnam("", "signed"); + + if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) { + $fp = fopen($signed, "r"); + $result = fread($fp, filesize($this->sign_key_file)); + $result = ''; + while(!feof($fp)){ + $result = $result . fread($fp, 1024); + } + fclose($fp); + } else { + $this->SetError($this->Lang("signing").openssl_error_string()); + $result = ''; + } + + unlink($file); + unlink($signed); + } + + return $result; + } + + /** + * Returns the start of a message boundary. + * @access private + */ + function GetBoundary($boundary, $charSet, $contentType, $encoding) { + $result = ''; + if($charSet == '') { + $charSet = $this->CharSet; + } + if($contentType == '') { + $contentType = $this->ContentType; + } + if($encoding == '') { + $encoding = $this->Encoding; + } + $result .= $this->TextLine('--' . $boundary); + $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet); + $result .= $this->LE; + $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding); + $result .= $this->LE; + + return $result; + } + + /** + * Returns the end of a message boundary. + * @access private + */ + function EndBoundary($boundary) { + return $this->LE . '--' . $boundary . '--' . $this->LE; + } + + /** + * Sets the message type. + * @access private + * @return void + */ + function SetMessageType() { + if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) { + $this->message_type = 'plain'; + } else { + if(count($this->attachment) > 0) { + $this->message_type = 'attachments'; + } + if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) { + $this->message_type = 'alt'; + } + if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) { + $this->message_type = 'alt_attachments'; + } + } + } + + /* Returns a formatted header line. + * @access private + * @return string + */ + function HeaderLine($name, $value) { + return $name . ': ' . $value . $this->LE; + } + + /** + * Returns a formatted mail line. + * @access private + * @return string + */ + function TextLine($value) { + return $value . $this->LE; + } + + ///////////////////////////////////////////////// + // CLASS METHODS, ATTACHMENTS + ///////////////////////////////////////////////// + + /** + * Adds an attachment from a path on the filesystem. + * Returns false if the file could not be found + * or accessed. + * @param string $path Path to the attachment. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { + if(!@is_file($path)) { + $this->SetError($this->Lang('file_access') . $path); + return false; + } + + $filename = basename($path); + if($name == '') { + $name = $filename; + } + + $cur = count($this->attachment); + $this->attachment[$cur][0] = $path; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $name; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = false; // isStringAttachment + $this->attachment[$cur][6] = 'attachment'; + $this->attachment[$cur][7] = 0; + + return true; + } + + /** + * Attaches all fs, string, and binary attachments to the message. + * Returns an empty string on failure. + * @access private + * @return string + */ + function AttachAll() { + /* Return text of body */ + $mime = array(); + + /* Add all attachments */ + for($i = 0; $i < count($this->attachment); $i++) { + /* Check for string attachment */ + $bString = $this->attachment[$i][5]; + if ($bString) { + $string = $this->attachment[$i][0]; + } else { + $path = $this->attachment[$i][0]; + } + + $filename = $this->attachment[$i][1]; + $name = $this->attachment[$i][2]; + $encoding = $this->attachment[$i][3]; + $type = $this->attachment[$i][4]; + $disposition = $this->attachment[$i][6]; + $cid = $this->attachment[$i][7]; + + $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); + $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); + $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); + + if($disposition == 'inline') { + $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); + } + + $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); + + /* Encode as string attachment */ + if($bString) { + $mime[] = $this->EncodeString($string, $encoding); + if($this->IsError()) { + return ''; + } + $mime[] = $this->LE.$this->LE; + } else { + $mime[] = $this->EncodeFile($path, $encoding); + if($this->IsError()) { + return ''; + } + $mime[] = $this->LE.$this->LE; + } + } + + $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); + + return join('', $mime); + } + + /** + * Encodes attachment in requested format. Returns an + * empty string on failure. + * @access private + * @return string + */ + function EncodeFile ($path, $encoding = 'base64') { + if(!@$fd = fopen($path, 'rb')) { + $this->SetError($this->Lang('file_open') . $path); + return ''; + } + $magic_quotes = get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + $file_buffer = fread($fd, filesize($path)); + $file_buffer = $this->EncodeString($file_buffer, $encoding); + fclose($fd); + @set_magic_quotes_runtime($magic_quotes); + + return $file_buffer; + } + + /** + * Encodes string to requested format. Returns an + * empty string on failure. + * @access private + * @return string + */ + function EncodeString ($str, $encoding = 'base64') { + $encoded = ''; + switch(strtolower($encoding)) { + case 'base64': + /* chunk_split is found in PHP >= 3.0.6 */ + $encoded = chunk_split(base64_encode($str), 76, $this->LE); + break; + case '7bit': + case '8bit': + $encoded = $this->FixEOL($str); + if (substr($encoded, -(strlen($this->LE))) != $this->LE) + $encoded .= $this->LE; + break; + case 'binary': + $encoded = $str; + break; + case 'quoted-printable': + $encoded = $this->EncodeQP($str); + break; + default: + $this->SetError($this->Lang('encoding') . $encoding); + break; + } + return $encoded; + } + + /** + * Encode a header string to best of Q, B, quoted or none. + * @access private + * @return string + */ + function EncodeHeader ($str, $position = 'text') { + $x = 0; + + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */ + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return ($encoded); + } else { + return ("\"$encoded\""); + } + } + $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + case 'comment': + $x = preg_match_all('/[()"]/', $str, $matches); + /* Fall-through */ + case 'text': + default: + $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($x == 0) { + return ($str); + } + + $maxlen = 75 - 7 - strlen($this->CharSet); + /* Try to select the encoding which should produce the shortest output */ + if (strlen($str)/3 < $x) { + $encoding = 'B'; + if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character + $encoded = $this->Base64EncodeWrapMB($str); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + } else { + $encoding = 'Q'; + $encoded = $this->EncodeQ($str, $position); + $encoded = $this->WrapText($encoded, $maxlen, true); + $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); + } + + $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); + $encoded = trim(str_replace("\n", $this->LE, $encoded)); + + return $encoded; + } + + /** + * Checks if a string contains multibyte characters. + * @access private + * @param string $str multi-byte text to wrap encode + * @return bool + */ + function HasMultiBytes($str) { + if (function_exists('mb_strlen')) { + return (strlen($str) > mb_strlen($str, $this->CharSet)); + } else { // Assume no multibytes (we can't handle without mbstring functions anyway) + return False; + } + } + + /** + * Correctly encodes and wraps long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php + * @access private + * @param string $str multi-byte text to wrap encode + * @return string + */ + function Base64EncodeWrapMB($str) { + $start = "=?".$this->CharSet."?B?"; + $end = "?="; + $encoded = ""; + + $mb_length = mb_strlen($str, $this->CharSet); + // Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + // Average multi-byte ratio + $ratio = $mb_length / strlen($str); + // Base64 has a 4:3 ratio + $offset = $avgLength = floor($length * $ratio * .75); + + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + $lookBack++; + } + while (strlen($chunk) > $length); + + $encoded .= $chunk . $this->LE; + } + + // Chomp the last linefeed + $encoded = substr($encoded, 0, -strlen($this->LE)); + return $encoded; + } + + /** + * Encode string to quoted-printable. + * @access private + * @return string + */ + function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) { + $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); + $lines = preg_split('/(?:\r\n|\r|\n)/', $input); + $eol = "\r\n"; + $escape = '='; + $output = ''; + while( list(, $line) = each($lines) ) { + $linlen = strlen($line); + $newline = ''; + for($i = 0; $i < $linlen; $i++) { + $c = substr( $line, $i, 1 ); + $dec = ord( $c ); + if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E + $c = '=2E'; + } + if ( $dec == 32 ) { + if ( $i == ( $linlen - 1 ) ) { // convert space at eol only + $c = '=20'; + } else if ( $space_conv ) { + $c = '=20'; + } + } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required + $h2 = floor($dec/16); + $h1 = floor($dec%16); + $c = $escape.$hex[$h2].$hex[$h1]; + } + if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted + $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay + $newline = ''; + // check if newline first character will be point or not + if ( $dec == 46 ) { + $c = '=2E'; + } + } + $newline .= $c; + } // end of for + $output .= $newline.$eol; + } // end of while + return $output; + } + + /** + * Encode string to q encoding. + * @access private + * @return string + */ + function EncodeQ ($str, $position = 'text') { + /* There should not be any EOL in the string */ + $encoded = preg_replace("[\r\n]", '', $str); + + switch (strtolower($position)) { + case 'phrase': + $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + case 'comment': + $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + case 'text': + default: + /* Replace every high ascii, control =, ? and _ characters */ + $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', + "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + } + + /* Replace every spaces to _ (more readable than =20) */ + $encoded = str_replace(' ', '_', $encoded); + + return $encoded; + } + + /** + * 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. + * @param string $string String attachment data. + * @param string $filename Name of the attachment. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return void + */ + function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') { + /* Append to $attachment array */ + $cur = count($this->attachment); + $this->attachment[$cur][0] = $string; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $filename; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = true; // isString + $this->attachment[$cur][6] = 'attachment'; + $this->attachment[$cur][7] = 0; + } + + /** + * 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". + * @param string $path Path to the attachment. + * @param string $cid Content ID of the attachment. Use this to identify + * the Id for accessing the image in an HTML form. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { + + if(!@is_file($path)) { + $this->SetError($this->Lang('file_access') . $path); + return false; + } + + $filename = basename($path); + if($name == '') { + $name = $filename; + } + + /* Append to $attachment array */ + $cur = count($this->attachment); + $this->attachment[$cur][0] = $path; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $name; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = false; + $this->attachment[$cur][6] = 'inline'; + $this->attachment[$cur][7] = $cid; + + return true; + } + + /** + * Returns true if an inline attachment is present. + * @access private + * @return bool + */ + function InlineImageExists() { + $result = false; + for($i = 0; $i < count($this->attachment); $i++) { + if($this->attachment[$i][6] == 'inline') { + $result = true; + break; + } + } + + return $result; + } + + ///////////////////////////////////////////////// + // CLASS METHODS, MESSAGE RESET + ///////////////////////////////////////////////// + + /** + * Clears all recipients assigned in the TO array. Returns void. + * @return void + */ + function ClearAddresses() { + $this->to = array(); + } + + /** + * Clears all recipients assigned in the CC array. Returns void. + * @return void + */ + function ClearCCs() { + $this->cc = array(); + } + + /** + * Clears all recipients assigned in the BCC array. Returns void. + * @return void + */ + function ClearBCCs() { + $this->bcc = array(); + } + + /** + * Clears all recipients assigned in the ReplyTo array. Returns void. + * @return void + */ + function ClearReplyTos() { + $this->ReplyTo = array(); + } + + /** + * Clears all recipients assigned in the TO, CC and BCC + * array. Returns void. + * @return void + */ + function ClearAllRecipients() { + $this->to = array(); + $this->cc = array(); + $this->bcc = array(); + } + + /** + * Clears all previously set filesystem, string, and binary + * attachments. Returns void. + * @return void + */ + function ClearAttachments() { + $this->attachment = array(); + } + + /** + * Clears all custom headers. Returns void. + * @return void + */ + function ClearCustomHeaders() { + $this->CustomHeader = array(); + } + + ///////////////////////////////////////////////// + // CLASS METHODS, MISCELLANEOUS + ///////////////////////////////////////////////// + + /** + * Adds the error message to the error container. + * Returns void. + * @access private + * @return void + */ + function SetError($msg) { + $this->error_count++; + $this->ErrorInfo = $msg; + } + + /** + * Returns the proper RFC 822 formatted date. + * @access private + * @return string + */ + function RFCDate() { + $tz = date('Z'); + $tzs = ($tz < 0) ? '-' : '+'; + $tz = abs($tz); + $tz = (int)($tz/3600)*100 + ($tz%3600)/60; + $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); + + return $result; + } + + /** + * Returns the appropriate server variable. Should work with both + * PHP 4.1.0+ as well as older versions. Returns an empty string + * if nothing is found. + * @access private + * @return mixed + */ + function ServerVar($varName) { + global $HTTP_SERVER_VARS; + global $HTTP_ENV_VARS; + + if(!isset($_SERVER)) { + $_SERVER = $HTTP_SERVER_VARS; + if(!isset($_SERVER['REMOTE_ADDR'])) { + $_SERVER = $HTTP_ENV_VARS; // must be Apache + } + } + + if(isset($_SERVER[$varName])) { + return $_SERVER[$varName]; + } else { + return ''; + } + } + + /** + * Returns the server hostname or 'localhost.localdomain' if unknown. + * @access private + * @return string + */ + function ServerHostname() { + if ($this->Hostname != '') { + $result = $this->Hostname; + } elseif ($this->ServerVar('SERVER_NAME') != '') { + $result = $this->ServerVar('SERVER_NAME'); + } else { + $result = 'localhost.localdomain'; + } + + return $result; + } + + /** + * Returns a message in the appropriate language. + * @access private + * @return string + */ + function Lang($key) { + if(count($this->language) < 1) { + $this->SetLanguage('en'); // set the default language + } + + if(isset($this->language[$key])) { + return $this->language[$key]; + } else { + return 'Language string failed to load: ' . $key; + } + } + + /** + * Returns true if an error occurred. + * @return bool + */ + function IsError() { + return ($this->error_count > 0); + } + + /** + * Changes every end of line from CR or LF to CRLF. + * @access private + * @return string + */ + function FixEOL($str) { + $str = str_replace("\r\n", "\n", $str); + $str = str_replace("\r", "\n", $str); + $str = str_replace("\n", $this->LE, $str); + return $str; + } + + /** + * Adds a custom header. + * @return void + */ + function AddCustomHeader($custom_header) { + $this->CustomHeader[] = explode(':', $custom_header, 2); + } + + /** + * Evaluates the message and returns modifications for inline images and backgrounds + * @access public + * @return $message + */ + function MsgHTML($message,$basedir='') { + preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); + if(isset($images[2])) { + foreach($images[2] as $i => $url) { + // do not change urls for absolute images (thanks to corvuscorax) + if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) { + $filename = basename($url); + $directory = dirname($url); + ($directory == '.')?$directory='':''; + $cid = 'cid:' . md5($filename); + $fileParts = split("\.", $filename); + $ext = $fileParts[1]; + $mimeType = $this->_mime_types($ext); + if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } + if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } + if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { + $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); + } + } + } + } + $this->IsHTML(true); + $this->Body = $message; + $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); + if ( !empty($textMsg) && empty($this->AltBody) ) { + $this->AltBody = html_entity_decode($textMsg); + } + if ( empty($this->AltBody) ) { + $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n"; + } + } + + /** + * Gets the mime type of the embedded or inline image + * @access private + * @return mime type of ext + */ + function _mime_types($ext = '') { + $mimes = array( + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'avi' => 'video/x-msvideo', + 'bin' => 'application/macbinary', + 'bmp' => 'image/bmp', + 'class' => 'application/octet-stream', + 'cpt' => 'application/mac-compactpro', + 'css' => 'text/css', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dll' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'doc' => 'application/msword', + 'dvi' => 'application/x-dvi', + 'dxr' => 'application/x-director', + 'eml' => 'message/rfc822', + 'eps' => 'application/postscript', + 'exe' => 'application/octet-stream', + 'gif' => 'image/gif', + 'gtar' => 'application/x-gtar', + 'htm' => 'text/html', + 'html' => 'text/html', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'hqx' => 'application/mac-binhex40', + 'js' => 'application/x-javascript', + 'lha' => 'application/octet-stream', + 'log' => 'text/plain', + 'lzh' => 'application/octet-stream', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mif' => 'application/vnd.mif', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpga' => 'audio/mpeg', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'png' => 'image/png', + 'ppt' => 'application/vnd.ms-powerpoint', + 'ps' => 'application/postscript', + 'psd' => 'application/octet-stream', + 'qt' => 'video/quicktime', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'rv' => 'video/vnd.rn-realvideo', + 'sea' => 'application/octet-stream', + 'shtml' => 'text/html', + 'sit' => 'application/x-stuffit', + 'so' => 'application/octet-stream', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'text' => 'text/plain', + 'txt' => 'text/plain', + 'tgz' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'wav' => 'audio/x-wav', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'word' => 'application/msword', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'xl' => 'application/excel', + 'xls' => 'application/vnd.ms-excel', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'zip' => 'application/zip' + ); + return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; + } + + /** + * Set (or reset) Class Objects (variables) + * + * Usage Example: + * $page->set('X-Priority', '3'); + * + * @access public + * @param string $name Parameter Name + * @param mixed $value Parameter Value + * NOTE: will not work with arrays, there are no arrays to set/reset + */ + function set ( $name, $value = '' ) { + if ( isset($this->$name) ) { + $this->$name = $value; + } else { + $this->SetError('Cannot set or reset variable ' . $name); + return false; + } + } + + /** + * Read a file from a supplied filename and return it. + * + * @access public + * @param string $filename Parameter File Name + */ + function getFile($filename) { + $return = ''; + if ($fp = fopen($filename, 'rb')) { + while (!feof($fp)) { + $return .= fread($fp, 1024); + } + fclose($fp); + return $return; + } else { + return false; + } + } + + /** + * Strips newlines to prevent header injection. + * @access private + * @param string $str String + * @return string + */ + function SecureHeader($str) { + $str = trim($str); + $str = str_replace("\r", "", $str); + $str = str_replace("\n", "", $str); + return $str; + } + + /** + * Set the private key file and password to sign the message. + * + * @access public + * @param string $key_filename Parameter File Name + * @param string $key_pass Password for private key + */ + function Sign($cert_filename, $key_filename, $key_pass) { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + } + +} + +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/class.pop3.php b/plugin/PHPMailer_v2.0.4/class.pop3.php new file mode 100644 index 000000000..0a6d8d45a --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/class.pop3.php @@ -0,0 +1,436 @@ +pop_conn = 0; + $this->connected = false; + $this->error = null; + } + + /** + * Combination of public events - connect, login, disconnect + * + * @param string $host + * @param integer $port + * @param integer $tval + * @param string $username + * @param string $password + */ + function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) + { + $this->host = $host; + + // If no port value is passed, retrieve it + if ($port == false) + { + $this->port = $this->POP3_PORT; + } + else + { + $this->port = $port; + } + + // If no port value is passed, retrieve it + if ($tval == false) + { + $this->tval = $this->POP3_TIMEOUT; + } + else + { + $this->tval = $tval; + } + + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + + // Refresh the error log + $this->error = null; + + // Connect + $result = $this->Connect($this->host, $this->port, $this->tval); + + if ($result) + { + $login_result = $this->Login($this->username, $this->password); + + if ($login_result) + { + $this->Disconnect(); + + return true; + } + + } + + // We need to disconnect regardless if the login succeeded + $this->Disconnect(); + + return false; + } + + /** + * Connect to the POP3 server + * + * @param string $host + * @param integer $port + * @param integer $tval + * @return boolean + */ + function Connect ($host, $port = false, $tval = 30) + { + // Are we already connected? + if ($this->connected) + { + return true; + } + + /* + On Windows this will raise a PHP Warning error if the hostname doesn't exist. + Rather than supress it with @fsockopen, let's capture it cleanly instead + */ + + set_error_handler(array(&$this, 'catchWarning')); + + // Connect to the POP3 server + $this->pop_conn = fsockopen($host, // POP3 Host + $port, // Port # + $errno, // Error Number + $errstr, // Error Message + $tval); // Timeout (seconds) + + // Restore the error handler + restore_error_handler(); + + // Does the Error Log now contain anything? + if ($this->error && $this->do_debug >= 1) + { + $this->displayErrors(); + } + + // Did we connect? + if ($this->pop_conn == false) + { + // It would appear not... + $this->error = array( + 'error' => "Failed to connect to server $host on port $port", + 'errno' => $errno, + 'errstr' => $errstr + ); + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + + return false; + } + + // Increase the stream time-out + + // Check for PHP 4.3.0 or later + if (version_compare(phpversion(), '4.3.0', 'ge')) + { + stream_set_timeout($this->pop_conn, $tval, 0); + } + else + { + // Does not work on Windows + if (substr(PHP_OS, 0, 3) !== 'WIN') + { + socket_set_timeout($this->pop_conn, $tval, 0); + } + } + + // Get the POP3 server response + $pop3_response = $this->getResponse(); + + // Check for the +OK + if ($this->checkResponse($pop3_response)) + { + // The connection is established and the POP3 server is talking + $this->connected = true; + return true; + } + + } + + /** + * Login to the POP3 server (does not support APOP yet) + * + * @param string $username + * @param string $password + * @return boolean + */ + function Login ($username = '', $password = '') + { + if ($this->connected == false) + { + $this->error = 'Not connected to POP3 server'; + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + } + + if (empty($username)) + { + $username = $this->username; + } + + if (empty($password)) + { + $password = $this->password; + } + + $pop_username = "USER $username" . $this->CRLF; + $pop_password = "PASS $password" . $this->CRLF; + + // Send the Username + $this->sendString($pop_username); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) + { + // Send the Password + $this->sendString($pop_password); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + + /** + * Disconnect from the POP3 server + */ + function Disconnect () + { + $this->sendString('QUIT'); + + fclose($this->pop_conn); + } + + /* + --------------- + Private Methods + --------------- + */ + + /** + * Get the socket response back. + * $size is the maximum number of bytes to retrieve + * + * @param integer $size + * @return string + */ + function getResponse ($size = 128) + { + $pop3_response = fgets($this->pop_conn, $size); + + return $pop3_response; + } + + /** + * Send a string down the open socket connection to the POP3 server + * + * @param string $string + * @return integer + */ + function sendString ($string) + { + $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); + + return $bytes_sent; + + } + + /** + * Checks the POP3 server response for +OK or -ERR + * + * @param string $string + * @return boolean + */ + function checkResponse ($string) + { + if (substr($string, 0, 3) !== '+OK') + { + $this->error = array( + 'error' => "Server reported an error: $string", + 'errno' => 0, + 'errstr' => '' + ); + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + + return false; + } + else + { + return true; + } + + } + + /** + * If debug is enabled, display the error message array + * + */ + function displayErrors () + { + echo '

';
+
+      foreach ($this->error as $single_error)
+    {
+        print_r($single_error);
+    }
+
+      echo '
'; + } + + /** + * Takes over from PHP for the socket warning handler + * + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + */ + function catchWarning ($errno, $errstr, $errfile, $errline) + { + $this->error[] = array( + 'error' => "Connecting to the POP3 server raised a PHP warning: ", + 'errno' => $errno, + 'errstr' => $errstr + ); + } + + // End of class +} +?> diff --git a/plugin/PHPMailer_v2.0.4/class.smtp.php b/plugin/PHPMailer_v2.0.4/class.smtp.php new file mode 100644 index 000000000..be084a116 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/class.smtp.php @@ -0,0 +1,1062 @@ +smtp_conn = 0; + $this->error = null; + $this->helo_rply = null; + + $this->do_debug = 0; + } + + /************************************************************* + * CONNECTION FUNCTIONS * + ***********************************************************/ + + /** + * 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 + * @return bool + */ + function Connect($host,$port=0,$tval=30) { + # set the error val to null so there is no confusion + $this->error = null; + + # make sure we are __not__ connected + if($this->connected()) { + # ok we are connected! what should we do? + # for now we will just give an error saying we + # are already connected + $this->error = array("error" => "Already connected to a server"); + return false; + } + + if(empty($port)) { + $port = $this->SMTP_PORT; + } + + #connect to the smtp server + $this->smtp_conn = fsockopen($host, # the host of the server + $port, # the port to use + $errno, # error number if any + $errstr, # error message if any + $tval); # give up after ? secs + # verify we connected properly + if(empty($this->smtp_conn)) { + $this->error = array("error" => "Failed to connect to server", + "errno" => $errno, + "errstr" => $errstr); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": $errstr ($errno)" . $this->CRLF; + } + return false; + } + + # sometimes the SMTP server takes a little longer to respond + # so we will give it a longer timeout for the first read + // Windows still does not have support for this timeout function + if(substr(PHP_OS, 0, 3) != "WIN") + socket_set_timeout($this->smtp_conn, $tval, 0); + + # get any announcement stuff + $announce = $this->get_lines(); + + # set the timeout of any socket functions at 1/10 of a second + //if(function_exists("socket_set_timeout")) + // socket_set_timeout($this->smtp_conn, 0, 100000); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; + } + + return true; + } + + /** + * Performs SMTP authentication. Must be run after running the + * Hello() method. Returns true if successfully authenticated. + * @access public + * @return bool + */ + function Authenticate($username, $password) { + // Start authentication + fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "AUTH not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + // Send encoded username + fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "Username not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + // Send encoded password + fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 235) { + $this->error = + array("error" => "Password not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return true; + } + + /** + * Returns true if connected to a server otherwise false + * @access private + * @return bool + */ + function Connected() { + if(!empty($this->smtp_conn)) { + $sock_status = socket_get_status($this->smtp_conn); + if($sock_status["eof"]) { + # hmm this is an odd situation... the socket is + # valid but we are not connected anymore + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE:" . $this->CRLF . + "EOF caught while checking if connected"; + } + $this->Close(); + return false; + } + return true; # everything looks good + } + return false; + } + + /** + * 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 + * @return void + */ + function Close() { + $this->error = null; # so there is no confusion + $this->helo_rply = null; + if(!empty($this->smtp_conn)) { + # close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = 0; + } + } + + /*************************************************************** + * SMTP COMMANDS * + *************************************************************/ + + /** + * 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 with the message headers + * and the message body being seperated by and additional . + * + * Implements rfc 821: DATA + * + * SMTP CODE INTERMEDIATE: 354 + * [data] + * . + * 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 + * @return bool + */ + function Data($msg_data) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Data() without being connected"); + return false; + } + + fputs($this->smtp_conn,"DATA" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 354) { + $this->error = + array("error" => "DATA command not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + # the server is ready to accept data! + # according to rfc 821 we should not send more than 1000 + # including the CRLF + # characters on a single line so we will break the data up + # into lines by \r and/or \n then if needed we will break + # each of those into smaller lines to fit within the limit. + # in addition we will be looking for lines that start with + # a period '.' and append and additional period '.' to that + # line. NOTE: this does not count towards are limit. + + # normalize the line breaks so we know the explode works + $msg_data = str_replace("\r\n","\n",$msg_data); + $msg_data = str_replace("\r","\n",$msg_data); + $lines = explode("\n",$msg_data); + + # we need to find a good way to determine is headers are + # in the msg_data or if it is a straight msg body + # currently I am assuming rfc 822 definitions of msg headers + # and if the first field of the first line (':' sperated) + # does not contain a space then it _should_ be a header + # and we can process all lines before a blank "" line as + # headers. + $field = substr($lines[0],0,strpos($lines[0],":")); + $in_headers = false; + if(!empty($field) && !strstr($field," ")) { + $in_headers = true; + } + + $max_line_length = 998; # used below; set here for ease in change + + while(list(,$line) = @each($lines)) { + $lines_out = null; + if($line == "" && $in_headers) { + $in_headers = false; + } + # ok we need to break this line up into several + # smaller lines + while(strlen($line) > $max_line_length) { + $pos = strrpos(substr($line,0,$max_line_length)," "); + + # Patch to fix DOS attack + if(!$pos) { + $pos = $max_line_length - 1; + } + + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos + 1); + # if we are processing headers we need to + # add a LWSP-char to the front of the new line + # rfc 822 on long msg headers + if($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + # now send the lines to the server + while(list(,$line_out) = @each($lines_out)) { + if(strlen($line_out) > 0) + { + if(substr($line_out, 0, 1) == ".") { + $line_out = "." . $line_out; + } + } + fputs($this->smtp_conn,$line_out . $this->CRLF); + } + } + + # ok all the message data has been sent so lets get this + # over with aleady + fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "DATA not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * 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: + * [ ] + * The definition of is defined in rfc 821 + * + * Implements rfc 821: EXPN + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 550 + * SMTP CODE ERROR : 500,501,502,504,421 + * @access public + * @return string array + */ + function Expand($name) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Expand() without being connected"); + return false; + } + + fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "EXPN not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + # parse the reply and place in our array to return to user + $entries = explode($this->CRLF,$rply); + while(list(,$l) = @each($entries)) { + $list[] = substr($l,4); + } + + return $list; + } + + /** + * 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 + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 501, 504, 421 + * @access public + * @return bool + */ + function Hello($host="") { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Hello() without being connected"); + return false; + } + + # if a hostname for the HELO was not specified determine + # a suitable one to send + if(empty($host)) { + # we need to determine some sort of appopiate default + # to send to the server + $host = "localhost"; + } + + // Send extended hello first (RFC 2821) + if(!$this->SendHello("EHLO", $host)) + { + if(!$this->SendHello("HELO", $host)) + return false; + } + + return true; + } + + /** + * Sends a HELO/EHLO command. + * @access private + * @return bool + */ + function SendHello($hello, $host) { + fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => $hello . " not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + $this->helo_rply = $rply; + + return true; + } + + /** + * 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 [ ] + * + * SMTP CODE SUCCESS: 211,214 + * SMTP CODE ERROR : 500,501,502,504,421 + * @access public + * @return string + */ + function Help($keyword="") { + $this->error = null; # to avoid confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Help() without being connected"); + return false; + } + + $extra = ""; + if(!empty($keyword)) { + $extra = " " . $keyword; + } + + fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 211 && $code != 214) { + $this->error = + array("error" => "HELP not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return $rply; + } + + /** + * 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 FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,421 + * @access public + * @return bool + */ + function Mail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Mail() without being connected"); + return false; + } + + $useVerp = ($this->do_verp ? "XVERP" : ""); + fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "MAIL not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Sends the command NOOP to the SMTP server. + * + * Implements from rfc 821: NOOP + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 421 + * @access public + * @return bool + */ + function Noop() { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Noop() without being connected"); + return false; + } + + fputs($this->smtp_conn,"NOOP" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "NOOP not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * 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 + * + * SMTP CODE SUCCESS: 221 + * SMTP CODE ERROR : 500 + * @access public + * @return bool + */ + function Quit($close_on_error=true) { + $this->error = null; # so there is no confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Quit() without being connected"); + return false; + } + + # send the quit command to the server + fputs($this->smtp_conn,"quit" . $this->CRLF); + + # get any good-bye messages + $byemsg = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; + } + + $rval = true; + $e = null; + + $code = substr($byemsg,0,3); + if($code != 221) { + # use e as a tmp var cause Close will overwrite $this->error + $e = array("error" => "SMTP server rejected quit command", + "smtp_code" => $code, + "smtp_rply" => substr($byemsg,4)); + $rval = false; + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $e["error"] . ": " . + $byemsg . $this->CRLF; + } + } + + if(empty($e) || $close_on_error) { + $this->Close(); + } + + return $rval; + } + + /** + * 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 TO: + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,552,553,450,451,452 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + function Recipient($to) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Recipient() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "RCPT not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Sends the RSET command to abort and transaction that is + * currently in progress. Returns true if successful false + * otherwise. + * + * Implements rfc 821: RSET + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500,501,504,421 + * @access public + * @return bool + */ + function Reset() { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Reset() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RSET" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "RSET failed", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return true; + } + + /** + * 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 FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function Send($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Send() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SEND not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * 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 FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function SendAndMail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendAndMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SAML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * 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 FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function SendOrMail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendOrMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SOML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * 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 + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 502 + * SMTP CODE ERROR : 500, 503 + * @access public + * @return bool + */ + function Turn() { + $this->error = array("error" => "This method, TURN, of the SMTP ". + "is not implemented"); + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; + } + return false; + } + + /** + * 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 + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,553 + * SMTP CODE ERROR : 500,501,502,421 + * @access public + * @return int + */ + function Verify($name) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Verify() without being connected"); + return false; + } + + fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "VRFY failed on name '$name'", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return $rply; + } + + /******************************************************************* + * INTERNAL FUNCTIONS * + ******************************************************************/ + + /** + * Read in as many lines as possible + * either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access private + * @return string + */ + function get_lines() { + $data = ""; + while($str = @fgets($this->smtp_conn,515)) { + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data was \"$data\"" . + $this->CRLF; + echo "SMTP -> get_lines(): \$str is \"$str\"" . + $this->CRLF; + } + $data .= $str; + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; + } + # if the 4th character is a space then we are done reading + # so just break the loop + if(substr($str,3,1) == " ") { break; } + } + return $data; + } + +} + + + ?> diff --git a/plugin/PHPMailer_v2.0.4/codeworxtech.html b/plugin/PHPMailer_v2.0.4/codeworxtech.html new file mode 100644 index 000000000..68ccaa931 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/codeworxtech.html @@ -0,0 +1,121 @@ + + + + + + +
+
+
+The http://phpmailer.codeworxtech.com/ website now carries a few +advertisements through the Google Adsense network to help offset +some of our costs.
+Thanks ....
+
+

My name is Andy Prevost, AKA "codeworxtech".
+www.codeworxtech.com for more information.
+

+

WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?

+

A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.

+

Now, the introductions:

+

Our company, Worx International Inc., is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer. +We have staff and offices in the United States, Caribbean, the Middle +East, and our primary development center in Canada. Our company is represented by +agents and resellers globally.

+

Worx International Inc. is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While Worx International Inc. can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.

+

Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.

+

Our developer tools are all Open Source. Here's a brief description:

+
    +
  • PHPMailer. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than 18000 times each and every month by developers looking for a stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is around 100 Kb), stable, and as complete a solution as you can find. Other tools are nowhere near as simple. And more importantly, most of our applications (including PHPMailer) is implemented in a smaller footprint than one competing email class. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at + http://phpmailer.codeworxtech.com/.
    + Please note: all of our focus is now on the PHPMailer for PHP5.
    + PS. While you are at it, please visit our sponsor's sites, click on their ads. + It helps offset some of our costs.
    + Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer for PHP5, and our next major task is to enhance our + exception/error handling with PHP 5's object oriented try/throw/catch mechanisms. If you are interested, let us know.
    +
    +
  • +
  • QuickCache. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at + http://quickcache.codeworxtech.com/.
    +
    +
  • +
  • QuickSkin. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at + http://quickskin.codeworxtech.com/.
    +
    +
  • +
+

We're committed to PHP and to the Open Source community.

+

Opportunities with Worx International Inc.:

+
    +
  • Resellers/Agents: We're always interested in talking with companies that +want to represent +Worx International Inc. in their markets. We also have private label programs for our commercial products (in certain circumstances).
  • +
  • Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with +Worx International Inc., we would be pleased to hear from you.
    +A few things to note:
    +
      +
    • experience level does not matter: from fresh out of college to multi-year experience - it's your + creative mind and a positive attitude we want
    • +
    • if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation
    • +
    • if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.
    • +
    • any contact that ignores any of these points will be discarded
    • +
  • +
  • Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.
  • +
+Regards,
+Andy Prevost (aka, codeworxtech)
+codeworxtech@users.sourceforge.net
+
+We now also offer website design. hosting, and remote forms processing. Visit WorxStudio.com for more information.
+
+
+ + diff --git a/plugin/PHPMailer_v2.0.4/docs/extending.html b/plugin/PHPMailer_v2.0.4/docs/extending.html new file mode 100644 index 000000000..f7c3200af --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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,photoFROM employeeWHEREid=$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/plugin/PHPMailer_v2.0.4/docs/faq.html b/plugin/PHPMailer_v2.0.4/docs/faq.html new file mode 100644 index 000000000..54ac18370 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/docs/phpmailer_sm.gif b/plugin/PHPMailer_v2.0.4/docs/phpmailer_sm.gif new file mode 100644 index 000000000..0244d2990 Binary files /dev/null and b/plugin/PHPMailer_v2.0.4/docs/phpmailer_sm.gif differ diff --git a/plugin/PHPMailer_v2.0.4/docs/pop3_article.txt b/plugin/PHPMailer_v2.0.4/docs/pop3_article.txt new file mode 100644 index 000000000..379c44e89 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/docs/use_gmail.txt b/plugin/PHPMailer_v2.0.4/docs/use_gmail.txt new file mode 100644 index 000000000..3669f5d23 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/examples/contents.html b/plugin/PHPMailer_v2.0.4/examples/contents.html new file mode 100644 index 000000000..70c7e3070 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/examples/images/bkgrnd.gif b/plugin/PHPMailer_v2.0.4/examples/images/bkgrnd.gif new file mode 100644 index 000000000..bc89624c0 Binary files /dev/null and b/plugin/PHPMailer_v2.0.4/examples/images/bkgrnd.gif differ diff --git a/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.gif b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.gif new file mode 100644 index 000000000..5e269714e Binary files /dev/null and b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.gif differ diff --git a/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.png b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.png new file mode 100644 index 000000000..abe0101f3 Binary files /dev/null and b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer.png differ diff --git a/plugin/PHPMailer_v2.0.4/examples/images/phpmailer_mini.gif b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer_mini.gif new file mode 100644 index 000000000..dc7d7827c Binary files /dev/null and b/plugin/PHPMailer_v2.0.4/examples/images/phpmailer_mini.gif differ diff --git a/plugin/PHPMailer_v2.0.4/examples/index.html b/plugin/PHPMailer_v2.0.4/examples/index.html new file mode 100644 index 000000000..d0a8b9d95 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/examples/pop3_before_smtp_test.php b/plugin/PHPMailer_v2.0.4/examples/pop3_before_smtp_test.php new file mode 100644 index 000000000..794b2a267 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/examples/test_gmail.php b/plugin/PHPMailer_v2.0.4/examples/test_gmail.php new file mode 100644 index 000000000..9b951f869 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/examples/test_gmail.php @@ -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 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/plugin/PHPMailer_v2.0.4/examples/test_mail.php b/plugin/PHPMailer_v2.0.4/examples/test_mail.php new file mode 100644 index 000000000..e87056e91 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/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/plugin/PHPMailer_v2.0.4/examples/test_sendmail.php b/plugin/PHPMailer_v2.0.4/examples/test_sendmail.php new file mode 100644 index 000000000..f0311665e --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/examples/test_sendmail.php @@ -0,0 +1,30 @@ +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/plugin/PHPMailer_v2.0.4/examples/test_smtp.php b/plugin/PHPMailer_v2.0.4/examples/test_smtp.php new file mode 100644 index 000000000..189f8daa1 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/examples/test_smtp.php @@ -0,0 +1,33 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); // telling the class to use SMTP +$mail->Host = "mail.yourdomain.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/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ar.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ar.php new file mode 100644 index 000000000..c7f343ae2 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ar.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'You must provide at least one ' . + 'recipient email address.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; +$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : '; +$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; +$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . + 'فشل في الارسال لكل من : '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; +$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: '; +$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: '; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-br.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-br.php new file mode 100644 index 000000000..dece2256a --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-br.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ca.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ca.php new file mode 100644 index 000000000..dfc8370ef --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ca.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ch.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ch.php new file mode 100644 index 000000000..5251402b0 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ch.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-cz.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-cz.php new file mode 100644 index 000000000..80b4eea1d --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-cz.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-de.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-de.php new file mode 100644 index 000000000..7e23f4be0 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-de.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-dk.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-dk.php new file mode 100644 index 000000000..120fd3bb4 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-dk.php @@ -0,0 +1,23 @@ + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; +$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-en.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-en.php new file mode 100644 index 000000000..41906b1e7 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-en.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-es.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-es.php new file mode 100644 index 000000000..b0d7d22e4 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-es.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-et.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-et.php new file mode 100644 index 000000000..943680cd1 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-et.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fi.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fi.php new file mode 100644 index 000000000..970ebc030 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fi.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fo.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fo.php new file mode 100644 index 000000000..b09414b19 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fo.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fr.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fr.php new file mode 100644 index 000000000..b40ec215d --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-fr.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-hu.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-hu.php new file mode 100644 index 000000000..5fac38a09 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-hu.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-it.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-it.php new file mode 100644 index 000000000..76a9f3a59 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-it.php @@ -0,0 +1,26 @@ +*/ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi'. + 'destinatari hanno generato errore: '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal'. + 'server.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ja.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ja.php new file mode 100644 index 000000000..6848ca380 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ja.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-nl.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-nl.php new file mode 100644 index 000000000..269b1522a --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-nl.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-no.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-no.php new file mode 100644 index 000000000..184d8857f --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-no.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-pl.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-pl.php new file mode 100644 index 000000000..bbc9cc9a8 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-pl.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ro.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ro.php new file mode 100644 index 000000000..4c6a4683d --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ro.php @@ -0,0 +1,24 @@ + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; +$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; +$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; +$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; +$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ru.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ru.php new file mode 100644 index 000000000..bc2dc2d5e --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-ru.php @@ -0,0 +1,23 @@ + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим ' . + 'адресам получателей не удалась: '; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.'; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; +$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-se.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-se.php new file mode 100644 index 000000000..f9100a67f --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-se.php @@ -0,0 +1,23 @@ + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-tr.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-tr.php new file mode 100644 index 000000000..99c5ac421 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-tr.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh.php new file mode 100644 index 000000000..31c10faae --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh.php @@ -0,0 +1,23 @@ + + */ + +$PHPMAILER_LANG = array(); +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; +$PHPMAILER_LANG['file_access'] = '無法訪問文件:'; +$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['signing'] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh_cn.php b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh_cn.php new file mode 100644 index 000000000..b01d806f0 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/language/phpmailer.lang-zh_cn.php @@ -0,0 +1,24 @@ + + */ + +$PHPMAILER_LANG = array(); + +$PHPMAILER_LANG["provide_address"] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG["mailer_not_supported"] = '发信客户端不被支持。'; +$PHPMAILER_LANG["execute"] = '无法执行:'; +$PHPMAILER_LANG["instantiate"] = '未知函数调用。'; +$PHPMAILER_LANG["authenticate"] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG["from_failed"] = '发送地址错误:'; +$PHPMAILER_LANG["recipients_failed"] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG["data_not_accepted"] = 'SMTP 错误:数据不被接受。'; +$PHPMAILER_LANG["connect_host"] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG["file_access"] = '无法访问文件:'; +$PHPMAILER_LANG["file_open"] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG["encoding"] = '未知编码: '; +$PHPMAILER_LANG["signing"] = 'Signing Error: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +?> \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/PHPMailer.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/PHPMailer.html new file mode 100644 index 000000000..f892db222 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/PHPMailer.html @@ -0,0 +1,2042 @@ + + + + + + Docs For Class PHPMailer + + + + +
+

Class PHPMailer

+ + +
+
Description
+ +
+ +

+ Located in /class.phpmailer.php (line 34) +

+ + +

+	
+			
+
+ + + + +
+
Variable Summary
+ +
+
+
+ string + $AltBody +
+
+ mixed + $attachment +
+
+ mixed + $bcc +
+
+ string + $Body +
+
+ mixed + $boundary +
+
+ mixed + $cc +
+
+ string + $CharSet +
+
+ string + $ConfirmReadingTo +
+
+ string + $ContentType +
+
+ mixed + $CustomHeader +
+
+ string + $Encoding +
+
+ string + $ErrorInfo +
+
+ mixed + $error_count +
+
+ string + $From +
+
+ string + $FromName +
+
+ string + $Helo +
+
+ string + $Host +
+
+ string + $Hostname +
+
+ mixed + $language +
+
+ mixed + $LE +
+
+ string + $Mailer +
+
+ string + $MessageID +
+
+ mixed + $message_type +
+
+ string + $Password +
+
+ string + $PluginDir +
+
+ int + $Port +
+
+ int + $Priority +
+
+ mixed + $ReplyTo +
+
+ string + $Sender +
+
+ string + $Sendmail +
+
+ mixed + $sign_cert_file +
+
+ mixed + $sign_key_file +
+
+ mixed + $sign_key_pass +
+
+ bool + $SingleTo +
+
+ mixed + $smtp +
+
+ bool + $SMTPAuth +
+
+ bool + $SMTPDebug +
+
+ bool + $SMTPKeepAlive +
+
+ string + $SMTPSecure +
+
+ string + $Subject +
+
+ int + $Timeout +
+
+ mixed + $to +
+
+ 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 + () +
+ +
+ void + getFile + (string $filename) +
+ +
+ void + HeaderLine + (mixed $name, mixed $value) +
+ +
+ bool + IsError + () +
+ +
+ void + IsHTML + (bool $bool) +
+ +
+ void + IsMail + () +
+ +
+ void + IsQmail + () +
+ +
+ void + IsSendmail + () +
+ +
+ void + IsSMTP + () +
+ +
+ $message + MsgHTML + (mixed $message, [mixed $basedir = '']) +
+ +
+ bool + Send + () +
+ +
+ void + set + (string $name, [mixed $value = '']) +
+ +
+ bool + SetLanguage + (string $lang_type, [string $lang_path = 'language/']) +
+ +
+ void + Sign + (mixed $cert_filename, string $key_filename, string $key_pass) +
+ +
+ void + SmtpClose + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + string + $AltBody + = '' (line 110) + +
+ + +

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.

+ + + + + +
+ +
+ +
+ + mixed + $attachment + = array() (line 253) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $bcc + = array() (line 251) + +
+ + + + + + + +
+ +
+ +
+ + string + $Body + = '' (line 101) + +
+ + +

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

+

If HTML then run IsHTML(true).

+ + + + + +
+ +
+ +
+ + mixed + $boundary + = array() (line 256) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cc + = array() (line 250) + +
+ + + + + + + +
+ +
+ +
+ + string + $CharSet + = 'iso-8859-1' (line 50) + +
+ + +

Sets the CharSet of the message.

+ + + + + +
+ +
+ +
+ + string + $ConfirmReadingTo + = '' (line 148) + +
+ + +

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

+ + + + + +
+ +
+ +
+ + string + $ContentType + = 'text/plain' (line 56) + +
+ + +

Sets the Content-type of the message.

+ + + + + +
+ +
+ +
+ + mixed + $CustomHeader + = array() (line 254) + +
+ + + + + + + +
+ +
+ +
+ + string + $Encoding + = '8bit' (line 63) + +
+ + +

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

+ + + + + +
+ +
+ +
+ + string + $ErrorInfo + = '' (line 69) + +
+ + +

Holds the most recent mailer error message.

+ + + + + +
+ +
+ +
+ + mixed + $error_count + = 0 (line 258) + +
+ + + + + + + +
+ +
+ +
+ + string + $From + = 'root@localhost' (line 75) + +
+ + +

Sets the From email address for the message.

+ + + + + +
+ +
+ +
+ + string + $FromName + = 'Root User' (line 81) + +
+ + +

Sets the From name of the message.

+ + + + + +
+ +
+ +
+ + string + $Helo + = '' (line 189) + +
+ + +

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

+ + + + + +
+ +
+ +
+ + string + $Host + = 'localhost' (line 177) + +
+ + +

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 156) + +
+ + +

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'.

+ + + + + +
+ +
+ +
+ + mixed + $language + = array() (line 257) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $LE + = "\n" (line 259) + +
+ + + + + + + +
+ +
+ +
+ + string + $Mailer + = 'mail' (line 123) + +
+ + +

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

+ + + + + +
+ +
+ +
+ + string + $MessageID + = '' (line 163) + +
+ + +

Sets the message ID to be used in the Message-Id header.

+

If empty, a unique id will be generated.

+ + + + + +
+ +
+ +
+ + mixed + $message_type + = '' (line 255) + +
+ + + + + + + +
+ +
+ +
+ + string + $Password + = '' (line 214) + +
+ + +

Sets SMTP password.

+ + + + + +
+ +
+ +
+ + string + $PluginDir + = '' (line 136) + +
+ + +

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 183) + +
+ + +

Sets the default SMTP server port.

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

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

+ + + + + +
+ +
+ +
+ + mixed + $ReplyTo + = array() (line 252) + +
+ + + + + + + +
+ +
+ +
+ + string + $Sender + = '' (line 88) + +
+ + +

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 129) + +
+ + +

Sets the path of the sendmail program.

+ + + + + +
+ +
+ +
+ + mixed + $sign_cert_file + = "" (line 260) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $sign_key_file + = "" (line 261) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $sign_key_pass + = "" (line 262) + +
+ + + + + + + +
+ +
+ +
+ + bool + $SingleTo + = false (line 242) + +
+ + +

Provides the ability to have the TO field process individual

+

emails, instead of sending to entire TO addresses

+ + + + + +
+ +
+ +
+ + mixed + $smtp + = NULL (line 248) + +
+ + + + + + + +
+ +
+ +
+ + bool + $SMTPAuth + = false (line 202) + +
+ + +

Sets SMTP authentication. Utilizes the Username and Password variables.

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

Sets SMTP class debugging on or off.

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

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 + $SMTPSecure + = "" (line 196) + +
+ + +

Sets connection prefix.

+

Options are "", "ssl" or "tls"

+ + + + + +
+ +
+ +
+ + string + $Subject + = '' (line 94) + +
+ + +

Sets the Subject of the message.

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

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

+ + + + + +
+ +
+ +
+ + mixed + $to + = array() (line 249) + +
+ + + + + + + +
+ +
+ +
+ + string + $Username + = '' (line 208) + +
+ + +

Sets SMTP username.

+ + + + + +
+ +
+ +
+ + string + $Version + = "2.0.4" (line 142) + +
+ + +

Holds PHPMailer version.

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

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

+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + +
+ +
+ AddAddress (line 324) +
+ + +

Adds a "To" address.

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

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 352) +
+ + +

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 338) +
+ + +

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 1704) +
+ + +

Adds a custom header.

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

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 364) +
+ + +

Adds a "Reply-To" address.

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

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 1535) +
+ + +

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

+ +
+ void + + ClearAddresses + + () +
+ + + +
+ +
+ +
+ ClearAllRecipients (line 1568) +
+ + +

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

+ +
+ void + + ClearAllRecipients + + () +
+ + + +
+ +
+ +
+ ClearAttachments (line 1579) +
+ + +

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

+ +
+ void + + ClearAttachments + + () +
+ + + +
+ +
+ +
+ ClearBCCs (line 1551) +
+ + +

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

+ +
+ void + + ClearBCCs + + () +
+ + + +
+ +
+ +
+ ClearCCs (line 1543) +
+ + +

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

+ +
+ void + + ClearCCs + + () +
+ + + +
+ +
+ +
+ ClearCustomHeaders (line 1587) +
+ + +

Clears all custom headers. Returns void.

+ +
+ void + + ClearCustomHeaders + + () +
+ + + +
+ +
+ +
+ ClearReplyTos (line 1559) +
+ + +

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

+ +
+ void + + ClearReplyTos + + () +
+ + + +
+ +
+ +
+ getFile (line 1868) +
+ + +

Read a file from a supplied filename and return it.

+
    +
  • access: public
  • +
+ +
+ void + + getFile + + (string $filename) +
+ +
    +
  • + string + $filename: Parameter File Name
  • +
+ + +
+ +
+ +
+ HeaderLine (line 1097) +
+ + + +
+ void + + HeaderLine + + (mixed $name, mixed $value) +
+ + + +
+ +
+ +
+ IsError (line 1684) +
+ + +

Returns true if an error occurred.

+ +
+ bool + + IsError + + () +
+ + + +
+ +
+ +
+ IsHTML (line 273) +
+ + +

Sets message type to HTML.

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

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

+ +
+ void + + IsMail + + () +
+ + + +
+ +
+ +
+ IsQmail (line 309) +
+ + +

Sets Mailer to send message using the qmail MTA.

+ +
+ void + + IsQmail + + () +
+ + + +
+ +
+ +
+ IsSendmail (line 301) +
+ + +

Sets Mailer to send message using the $Sendmail program.

+ +
+ void + + IsSendmail + + () +
+ + + +
+ +
+ +
+ IsSMTP (line 285) +
+ + +

Sets Mailer to send message using SMTP.

+ +
+ void + + IsSMTP + + () +
+ + + +
+ +
+ +
+ MsgHTML (line 1713) +
+ + +

Evaluates the message and returns modifications for inline images and backgrounds

+
    +
  • access: public
  • +
+ +
+ $message + + MsgHTML + + (mixed $message, [mixed $basedir = '']) +
+ + + +
+ +
+ +
+ Send (line 380) +
+ + +

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 + + () +
+ + + +
+ +
+ +
+ set (line 1853) +
+ + +

Set (or reset) Class Objects (variables)

+

Usage Example: $page->set('X-Priority', '3');

+
    +
  • access: public
  • +
+ +
+ void + + set + + (string $name, [mixed $value = '']) +
+ +
    +
  • + string + $name: Parameter Name
  • +
  • + mixed + $value: Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset
  • +
+ + +
+ +
+ +
+ SetLanguage (line 647) +
+ + +

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 = 'language/']) +
+ +
    +
  • + string + $lang_type: Type of language (e.g. Portuguese: "br")
  • +
  • + string + $lang_path: Path to the language file directory
  • +
+ + +
+ +
+ +
+ Sign (line 1901) +
+ + +

Set the private key file and password to sign the message.

+
    +
  • access: public
  • +
+ +
+ void + + Sign + + (mixed $cert_filename, string $key_filename, string $key_pass) +
+ +
    +
  • + string + $key_filename: Parameter File Name
  • +
  • + string + $key_pass: Password for private key
  • +
+ + +
+ +
+ +
+ SmtpClose (line 629) +
+ + +

Closes the active SMTP session if one exists.

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

+ Documentation generated on Thu, 02 Apr 2009 21:19:48 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/POP3.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/POP3.html new file mode 100644 index 000000000..66d3d8afd --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/POP3.html @@ -0,0 +1,649 @@ + + + + + + Docs For Class POP3 + + + + +
+

Class POP3

+ + +
+
Description
+ +
+ +

+ Located in /class.pop3.php (line 46) +

+ + +

+	
+			
+
+ + + + +
+
Variable Summary
+ +
+
+
+ string + $CRLF +
+
+ int + $do_debug +
+
+ string + $host +
+
+ string + $password +
+
+ int + $POP3_PORT +
+
+ int + $POP3_TIMEOUT +
+
+ int + $port +
+
+ int + $tval +
+
+ string + $username +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ POP3 + POP3 + () +
+ +
+ void + Authorise + (string $host, [integer $port = false], [integer $tval = false], string $username, string $password, mixed $debug_level) +
+ +
+ void + catchWarning + (integer $errno, string $errstr, string $errfile, integer $errline) +
+ +
+ boolean + checkResponse + (string $string) +
+ +
+ boolean + Connect + (string $host, [integer $port = false], [integer $tval = 30]) +
+ +
+ void + Disconnect + () +
+ +
+ void + displayErrors + () +
+ +
+ string + getResponse + ([integer $size = 128]) +
+ +
+ boolean + Login + ([string $username = ''], [string $password = '']) +
+ +
+ integer + sendString + (string $string) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + string + $CRLF + = "\r\n" (line 64) + +
+ + +

POP3 Carriage Return + Line Feed

+ + + + + +
+ +
+ +
+ + int + $do_debug + = 2 (line 70) + +
+ + +

Displaying Debug warnings? (0 = now, 1+ = yes)

+ + + + + +
+ +
+ +
+ + string + $host + (line 76) + +
+ + +

POP3 Mail Server

+ + + + + +
+ +
+ +
+ + string + $password + (line 100) + +
+ + +

POP3 Password

+ + + + + +
+ +
+ +
+ + int + $POP3_PORT + = 110 (line 52) + +
+ + +

Default POP3 port

+ + + + + +
+ +
+ +
+ + int + $POP3_TIMEOUT + = 30 (line 58) + +
+ + +

Default Timeout

+ + + + + +
+ +
+ +
+ + int + $port + (line 82) + +
+ + +

POP3 Port

+ + + + + +
+ +
+ +
+ + int + $tval + (line 88) + +
+ + +

POP3 Timeout Value

+ + + + + +
+ +
+ +
+ + string + $username + (line 94) + +
+ + +

POP3 Username

+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + +
+ +
+ Constructor POP3 (line 115) +
+ + +

Constructor, sets the initial values

+ +
+ POP3 + + POP3 + + () +
+ + + +
+ +
+ +
+ Authorise (line 131) +
+ + +

Combination of public events - connect, login, disconnect

+ +
+ void + + Authorise + + (string $host, [integer $port = false], [integer $tval = false], string $username, string $password, mixed $debug_level) +
+ +
    +
  • + string + $host
  • +
  • + integer + $port
  • +
  • + integer + $tval
  • +
  • + string + $username
  • +
  • + string + $password
  • +
+ + +
+ +
+ +
+ catchWarning (line 425) +
+ + +

Takes over from PHP for the socket warning handler

+ +
+ void + + catchWarning + + (integer $errno, string $errstr, string $errfile, integer $errline) +
+ +
    +
  • + integer + $errno
  • +
  • + string + $errstr
  • +
  • + string + $errfile
  • +
  • + integer + $errline
  • +
+ + +
+ +
+ +
+ checkResponse (line 377) +
+ + +

Checks the POP3 server response for +OK or -ERR

+ +
+ boolean + + checkResponse + + (string $string) +
+ +
    +
  • + string + $string
  • +
+ + +
+ +
+ +
+ Connect (line 192) +
+ + +

Connect to the POP3 server

+ +
+ boolean + + Connect + + (string $host, [integer $port = false], [integer $tval = 30]) +
+ +
    +
  • + string + $host
  • +
  • + integer + $port
  • +
  • + integer + $tval
  • +
+ + +
+ +
+ +
+ Disconnect (line 330) +
+ + +

Disconnect from the POP3 server

+ +
+ void + + Disconnect + + () +
+ + + +
+ +
+ +
+ displayErrors (line 405) +
+ + +

If debug is enabled, display the error message array

+ +
+ void + + displayErrors + + () +
+ + + +
+ +
+ +
+ getResponse (line 350) +
+ + +

Get the socket response back.

+

$size is the maximum number of bytes to retrieve

+ +
+ string + + getResponse + + ([integer $size = 128]) +
+ +
    +
  • + integer + $size
  • +
+ + +
+ +
+ +
+ Login (line 277) +
+ + +

Login to the POP3 server (does not support APOP yet)

+ +
+ boolean + + Login + + ([string $username = ''], [string $password = '']) +
+ +
    +
  • + string + $username
  • +
  • + string + $password
  • +
+ + +
+ +
+ +
+ sendString (line 363) +
+ + +

Send a string down the open socket connection to the POP3 server

+ +
+ integer + + sendString + + (string $string) +
+ +
    +
  • + string + $string
  • +
+ + +
+ +
+
+ + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:49 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/SMTP.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/SMTP.html new file mode 100644 index 000000000..7c6c6697b --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/SMTP.html @@ -0,0 +1,755 @@ + + + + + + Docs For Class SMTP + + + + +
+

Class SMTP

+ + +
+
Description
+ +
+ +

+ Located in /class.smtp.php (line 36) +

+ + +

+	
+			
+
+ + + + +
+
Variable Summary
+ +
+
+
+ string + $CRLF +
+
+ bool + $do_debug +
+
+ bool + $do_verp +
+
+ 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 48) + +
+ + +

SMTP reply line ending

+ + + + + +
+ +
+ +
+ + bool + $do_debug + (line 54) + +
+ + +

Sets whether debugging is turned on

+ + + + + +
+ +
+ +
+ + bool + $do_verp + = false (line 60) + +
+ + +

Sets VERP use on/off (default is off)

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

SMTP server port

+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + +
+ +
+ Constructor SMTP (line 75) +
+ + +

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

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

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 249) +
+ + +

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 100) +
+ + +

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 282) +
+ + +

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 421) +
+ + +

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 472) +
+ + +

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 546) +
+ + +

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 598) +
+ + +

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 641) +
+ + +

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 684) +
+ + +

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 738) +
+ + +

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 782) +
+ + +

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 831) +
+ + +

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 879) +
+ + +

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 927) +
+ + +

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 972) +
+ + +

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 994) +
+ + +

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) +
+ + + +
+ +
+
+ + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:51 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_phpmailer_php.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_phpmailer_php.html new file mode 100644 index 000000000..bfcd69009 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_phpmailer_php.html @@ -0,0 +1,63 @@ + + + + + + Docs for page class.phpmailer.php + + + + +
+

/class.phpmailer.php

+ + +
+
Description
+ +
+ + + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ PHPMailer + + +
+
+
+ + + + + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:46 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_pop3_php.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_pop3_php.html new file mode 100644 index 000000000..b30da7980 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_pop3_php.html @@ -0,0 +1,63 @@ + + + + + + Docs for page class.pop3.php + + + + +
+

/class.pop3.php

+ + +
+
Description
+ +
+ + + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ POP3 + + +
+
+
+ + + + + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:49 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_smtp_php.html b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_smtp_php.html new file mode 100644 index 000000000..d43e6f8ea --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/PHPMailer/_v2.0.4_PHPMailer_v2.0.4_class_smtp_php.html @@ -0,0 +1,63 @@ + + + + + + Docs for page class.smtp.php + + + + +
+

/class.smtp.php

+ + +
+
Description
+ +
+ + + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ SMTP + + +
+
+
+ + + + + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:49 -0400 by phpDocumentor 1.3.0RC3 +

+
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.phpmailer.php.html b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.phpmailer.php.html new file mode 100644 index 000000000..bb7cddb15 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.phpmailer.php.html @@ -0,0 +1,1951 @@ + + + + + + File Source for class.phpmailer.php + + + + +

Source for file class.phpmailer.php

+

Documentation is available at class.phpmailer.php

+
+
  1. <?php
  2. +
  3. /*~ class.phpmailer.php
  4. +
  5. .---------------------------------------------------------------------------.
  6. +
  7. | Software: PHPMailer - PHP email class |
  8. +
  9. | Version: 2.0.4 |
  10. +
  11. | Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
  12. +
  13. | Info: http://phpmailer.sourceforge.net |
  14. +
  15. | Support: http://sourceforge.net/projects/phpmailer/ |
  16. +
  17. | ------------------------------------------------------------------------- |
  18. +
  19. | Author: Andy Prevost (project admininistrator) |
  20. +
  21. | Author: Brent R. Matzelle (original founder) |
  22. +
  23. | Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
  24. +
  25. | Copyright (c) 2001-2003, Brent R. Matzelle |
  26. +
  27. | ------------------------------------------------------------------------- |
  28. +
  29. | License: Distributed under the Lesser General Public License (LGPL) |
  30. +
  31. | http://www.gnu.org/copyleft/lesser.html |
  32. +
  33. | This program is distributed in the hope that it will be useful - WITHOUT |
  34. +
  35. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
  36. +
  37. | FITNESS FOR A PARTICULAR PURPOSE. |
  38. +
  39. | ------------------------------------------------------------------------- |
  40. +
  41. | We offer a number of paid services (www.codeworxtech.com): |
  42. +
  43. | - Web Hosting on highly optimized fast and secure servers |
  44. +
  45. | - Technology Consulting |
  46. +
  47. | - Oursourcing (highly qualified programmers and graphic designers) |
  48. +
  49. '---------------------------------------------------------------------------'
  50. +
  51.  
  52. +
  53.  
  54. +
  55.  
  56. +
  57. /**
  58. +
  59. * PHPMailer - PHP email transport class
  60. +
  61. * @package PHPMailer
  62. +
  63. * @author Andy Prevost
  64. +
  65. * @copyright 2004 - 2009 Andy Prevost
  66. +
  67. */
  68. +
  69.  
  70. +
  71. class PHPMailer {
  72. +
  73.  
  74. +
  75. /////////////////////////////////////////////////
  76. +
  77. // PROPERTIES, PUBLIC
  78. +
  79. /////////////////////////////////////////////////
  80. +
  81.  
  82. +
  83. +
  84.  
  85. +
  86. /**
  87. +
  88. * Email priority (1 = High, 3 = Normal, 5 = low).
  89. +
  90. * @var int
  91. +
  92. */
  93. +
  94. var $Priority = 3;
  95. +
  96.  
  97. +
  98. /**
  99. +
  100. * Sets the CharSet of the message.
  101. +
  102. * @var string
  103. +
  104. */
  105. +
  106. var $CharSet = 'iso-8859-1';
  107. +
  108.  
  109. +
  110. /**
  111. +
  112. * Sets the Content-type of the message.
  113. +
  114. * @var string
  115. +
  116. */
  117. +
  118. var $ContentType = 'text/plain';
  119. +
  120.  
  121. +
  122. /**
  123. +
  124. * Sets the Encoding of the message. Options for this are "8bit",
  125. +
  126. * "7bit", "binary", "base64", and "quoted-printable".
  127. +
  128. * @var string
  129. +
  130. */
  131. +
  132. var $Encoding = '8bit';
  133. +
  134.  
  135. +
  136. /**
  137. +
  138. * Holds the most recent mailer error message.
  139. +
  140. * @var string
  141. +
  142. */
  143. +
  144. var $ErrorInfo = '';
  145. +
  146.  
  147. +
  148. /**
  149. +
  150. * Sets the From email address for the message.
  151. +
  152. * @var string
  153. +
  154. */
  155. +
  156. var $From = 'root@localhost';
  157. +
  158.  
  159. +
  160. /**
  161. +
  162. * Sets the From name of the message.
  163. +
  164. * @var string
  165. +
  166. */
  167. +
  168. var $FromName = 'Root User';
  169. +
  170.  
  171. +
  172. /**
  173. +
  174. * Sets the Sender email (Return-Path) of the message. If not empty,
  175. +
  176. * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
  177. +
  178. * @var string
  179. +
  180. */
  181. +
  182. var $Sender = '';
  183. +
  184.  
  185. +
  186. /**
  187. +
  188. * Sets the Subject of the message.
  189. +
  190. * @var string
  191. +
  192. */
  193. +
  194. var $Subject = '';
  195. +
  196.  
  197. +
  198. /**
  199. +
  200. * Sets the Body of the message. This can be either an HTML or text body.
  201. +
  202. * If HTML then run IsHTML(true).
  203. +
  204. * @var string
  205. +
  206. */
  207. +
  208. var $Body = '';
  209. +
  210.  
  211. +
  212. /**
  213. +
  214. * Sets the text-only body of the message. This automatically sets the
  215. +
  216. * email to multipart/alternative. This body can be read by mail
  217. +
  218. * clients that do not have HTML email capability such as mutt. Clients
  219. +
  220. * that can read HTML will view the normal Body.
  221. +
  222. * @var string
  223. +
  224. */
  225. +
  226. var $AltBody = '';
  227. +
  228.  
  229. +
  230. /**
  231. +
  232. * Sets word wrapping on the body of the message to a given number of
  233. +
  234. * characters.
  235. +
  236. * @var int
  237. +
  238. */
  239. +
  240. var $WordWrap = 0;
  241. +
  242.  
  243. +
  244. /**
  245. +
  246. * Method to send mail: ("mail", "sendmail", or "smtp").
  247. +
  248. * @var string
  249. +
  250. */
  251. +
  252. var $Mailer = 'mail';
  253. +
  254.  
  255. +
  256. /**
  257. +
  258. * Sets the path of the sendmail program.
  259. +
  260. * @var string
  261. +
  262. */
  263. +
  264. var $Sendmail = '/usr/sbin/sendmail';
  265. +
  266.  
  267. +
  268. /**
  269. +
  270. * Path to PHPMailer plugins. This is now only useful if the SMTP class
  271. +
  272. * is in a different directory than the PHP include path.
  273. +
  274. * @var string
  275. +
  276. */
  277. +
  278. var $PluginDir = '';
  279. +
  280.  
  281. +
  282. /**
  283. +
  284. * Holds PHPMailer version.
  285. +
  286. * @var string
  287. +
  288. */
  289. +
  290. var $Version = "2.0.4";
  291. +
  292.  
  293. +
  294. /**
  295. +
  296. * Sets the email address that a reading confirmation will be sent.
  297. +
  298. * @var string
  299. +
  300. */
  301. +
  302. var $ConfirmReadingTo = '';
  303. +
  304.  
  305. +
  306. /**
  307. +
  308. * Sets the hostname to use in Message-Id and Received headers
  309. +
  310. * and as default HELO string. If empty, the value returned
  311. +
  312. * by SERVER_NAME is used or 'localhost.localdomain'.
  313. +
  314. * @var string
  315. +
  316. */
  317. +
  318. var $Hostname = '';
  319. +
  320.  
  321. +
  322. /**
  323. +
  324. * Sets the message ID to be used in the Message-Id header.
  325. +
  326. * If empty, a unique id will be generated.
  327. +
  328. * @var string
  329. +
  330. */
  331. +
  332. var $MessageID = '';
  333. +
  334.  
  335. +
  336. /////////////////////////////////////////////////
  337. +
  338. // PROPERTIES FOR SMTP
  339. +
  340. /////////////////////////////////////////////////
  341. +
  342.  
  343. +
  344. +
  345.  
  346. +
  347. /**
  348. +
  349. * Sets the SMTP hosts. All hosts must be separated by a
  350. +
  351. * semicolon. You can also specify a different port
  352. +
  353. * for each host by using this format: [hostname:port]
  354. +
  355. * (e.g. "smtp1.example.com:25;smtp2.example.com").
  356. +
  357. * Hosts will be tried in order.
  358. +
  359. * @var string
  360. +
  361. */
  362. +
  363. var $Host = 'localhost';
  364. +
  365.  
  366. +
  367. /**
  368. +
  369. * Sets the default SMTP server port.
  370. +
  371. * @var int
  372. +
  373. */
  374. +
  375. var $Port = 25;
  376. +
  377.  
  378. +
  379. /**
  380. +
  381. * Sets the SMTP HELO of the message (Default is $Hostname).
  382. +
  383. * @var string
  384. +
  385. */
  386. +
  387. var $Helo = '';
  388. +
  389.  
  390. +
  391. /**
  392. +
  393. * Sets connection prefix.
  394. +
  395. * Options are "", "ssl" or "tls"
  396. +
  397. * @var string
  398. +
  399. */
  400. +
  401. var $SMTPSecure = "";
  402. +
  403.  
  404. +
  405. /**
  406. +
  407. * Sets SMTP authentication. Utilizes the Username and Password variables.
  408. +
  409. * @var bool
  410. +
  411. */
  412. +
  413. var $SMTPAuth = false;
  414. +
  415.  
  416. +
  417. /**
  418. +
  419. * Sets SMTP username.
  420. +
  421. * @var string
  422. +
  423. */
  424. +
  425. var $Username = '';
  426. +
  427.  
  428. +
  429. /**
  430. +
  431. * Sets SMTP password.
  432. +
  433. * @var string
  434. +
  435. */
  436. +
  437. var $Password = '';
  438. +
  439.  
  440. +
  441. /**
  442. +
  443. * Sets the SMTP server timeout in seconds. This function will not
  444. +
  445. * work with the win32 version.
  446. +
  447. * @var int
  448. +
  449. */
  450. +
  451. var $Timeout = 10;
  452. +
  453.  
  454. +
  455. /**
  456. +
  457. * Sets SMTP class debugging on or off.
  458. +
  459. * @var bool
  460. +
  461. */
  462. +
  463. var $SMTPDebug = false;
  464. +
  465.  
  466. +
  467. /**
  468. +
  469. * Prevents the SMTP connection from being closed after each mail
  470. +
  471. * sending. If this is set to true then to close the connection
  472. +
  473. * requires an explicit call to SmtpClose().
  474. +
  475. * @var bool
  476. +
  477. */
  478. +
  479. var $SMTPKeepAlive = false;
  480. +
  481.  
  482. +
  483. /**
  484. +
  485. * Provides the ability to have the TO field process individual
  486. +
  487. * emails, instead of sending to entire TO addresses
  488. +
  489. * @var bool
  490. +
  491. */
  492. +
  493. var $SingleTo = false;
  494. +
  495.  
  496. +
  497. /////////////////////////////////////////////////
  498. +
  499. // PROPERTIES, PRIVATE
  500. +
  501. /////////////////////////////////////////////////
  502. +
  503.  
  504. +
  505. +
  506.  
  507. +
  508. var $smtp = NULL;
  509. +
  510. var $to = array();
  511. +
  512. var $cc = array();
  513. +
  514. var $bcc = array();
  515. +
  516. var $ReplyTo = array();
  517. +
  518. var $attachment = array();
  519. +
  520. var $CustomHeader = array();
  521. +
  522. var $message_type = '';
  523. +
  524. var $boundary = array();
  525. +
  526. var $language = array();
  527. +
  528. var $error_count = 0;
  529. +
  530. var $LE = "\n";
  531. +
  532. var $sign_cert_file = "";
  533. +
  534. var $sign_key_file = "";
  535. +
  536. var $sign_key_pass = "";
  537. +
  538.  
  539. +
  540. /////////////////////////////////////////////////
  541. +
  542. // METHODS, VARIABLES
  543. +
  544. /////////////////////////////////////////////////
  545. +
  546.  
  547. +
  548. +
  549.  
  550. +
  551. /**
  552. +
  553. * Sets message type to HTML.
  554. +
  555. * @param bool $bool
  556. +
  557. * @return void
  558. +
  559. */
  560. +
  561. function IsHTML($bool) {
  562. +
  563. if($bool == true) {
  564. +
  565. $this->ContentType = 'text/html';
  566. +
  567. } else {
  568. +
  569. $this->ContentType = 'text/plain';
  570. +
  571. }
  572. +
  573. }
  574. +
  575.  
  576. +
  577. /**
  578. +
  579. * Sets Mailer to send message using SMTP.
  580. +
  581. * @return void
  582. +
  583. */
  584. +
  585. function IsSMTP() {
  586. +
  587. $this->Mailer = 'smtp';
  588. +
  589. }
  590. +
  591.  
  592. +
  593. /**
  594. +
  595. * Sets Mailer to send message using PHP mail() function.
  596. +
  597. * @return void
  598. +
  599. */
  600. +
  601. function IsMail() {
  602. +
  603. $this->Mailer = 'mail';
  604. +
  605. }
  606. +
  607.  
  608. +
  609. /**
  610. +
  611. * Sets Mailer to send message using the $Sendmail program.
  612. +
  613. * @return void
  614. +
  615. */
  616. +
  617. function IsSendmail() {
  618. +
  619. $this->Mailer = 'sendmail';
  620. +
  621. }
  622. +
  623.  
  624. +
  625. /**
  626. +
  627. * Sets Mailer to send message using the qmail MTA.
  628. +
  629. * @return void
  630. +
  631. */
  632. +
  633. function IsQmail() {
  634. +
  635. $this->Sendmail = '/var/qmail/bin/sendmail';
  636. +
  637. $this->Mailer = 'sendmail';
  638. +
  639. }
  640. +
  641.  
  642. +
  643. /////////////////////////////////////////////////
  644. +
  645. // METHODS, RECIPIENTS
  646. +
  647. /////////////////////////////////////////////////
  648. +
  649.  
  650. +
  651. +
  652.  
  653. +
  654. /**
  655. +
  656. * Adds a "To" address.
  657. +
  658. * @param string $address
  659. +
  660. * @param string $name
  661. +
  662. * @return void
  663. +
  664. */
  665. +
  666. function AddAddress($address, $name = '') {
  667. +
  668. $cur = count($this->to);
  669. +
  670. $this->to[$cur][0] = trim($address);
  671. +
  672. $this->to[$cur][1] = $name;
  673. +
  674. }
  675. +
  676.  
  677. +
  678. /**
  679. +
  680. * Adds a "Cc" address. Note: this function works
  681. +
  682. * with the SMTP mailer on win32, not with the "mail"
  683. +
  684. * mailer.
  685. +
  686. * @param string $address
  687. +
  688. * @param string $name
  689. +
  690. * @return void
  691. +
  692. */
  693. +
  694. function AddCC($address, $name = '') {
  695. +
  696. $cur = count($this->cc);
  697. +
  698. $this->cc[$cur][0] = trim($address);
  699. +
  700. $this->cc[$cur][1] = $name;
  701. +
  702. }
  703. +
  704.  
  705. +
  706. /**
  707. +
  708. * Adds a "Bcc" address. Note: this function works
  709. +
  710. * with the SMTP mailer on win32, not with the "mail"
  711. +
  712. * mailer.
  713. +
  714. * @param string $address
  715. +
  716. * @param string $name
  717. +
  718. * @return void
  719. +
  720. */
  721. +
  722. function AddBCC($address, $name = '') {
  723. +
  724. $cur = count($this->bcc);
  725. +
  726. $this->bcc[$cur][0] = trim($address);
  727. +
  728. $this->bcc[$cur][1] = $name;
  729. +
  730. }
  731. +
  732.  
  733. +
  734. /**
  735. +
  736. * Adds a "Reply-To" address.
  737. +
  738. * @param string $address
  739. +
  740. * @param string $name
  741. +
  742. * @return void
  743. +
  744. */
  745. +
  746. function AddReplyTo($address, $name = '') {
  747. +
  748. $cur = count($this->ReplyTo);
  749. +
  750. $this->ReplyTo[$cur][0] = trim($address);
  751. +
  752. $this->ReplyTo[$cur][1] = $name;
  753. +
  754. }
  755. +
  756.  
  757. +
  758. /////////////////////////////////////////////////
  759. +
  760. // METHODS, MAIL SENDING
  761. +
  762. /////////////////////////////////////////////////
  763. +
  764.  
  765. +
  766. +
  767.  
  768. +
  769. /**
  770. +
  771. * Creates message and assigns Mailer. If the message is
  772. +
  773. * not sent successfully then it returns false. Use the ErrorInfo
  774. +
  775. * variable to view description of the error.
  776. +
  777. * @return bool
  778. +
  779. */
  780. +
  781. function Send() {
  782. +
  783. $header = '';
  784. +
  785. $body = '';
  786. +
  787. $result = true;
  788. +
  789.  
  790. +
  791. if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
  792. +
  793. $this->SetError($this->Lang('provide_address'));
  794. +
  795. return false;
  796. +
  797. }
  798. +
  799.  
  800. +
  801. /* Set whether the message is multipart/alternative */
  802. +
  803. if(!empty($this->AltBody)) {
  804. +
  805. $this->ContentType = 'multipart/alternative';
  806. +
  807. }
  808. +
  809.  
  810. +
  811. $this->error_count = 0; // reset errors
  812. +
  813. $this->SetMessageType();
  814. +
  815. $header .= $this->CreateHeader();
  816. +
  817. $body = $this->CreateBody();
  818. +
  819.  
  820. +
  821. if($body == '') {
  822. +
  823. return false;
  824. +
  825. }
  826. +
  827.  
  828. +
  829. /* Choose the mailer */
  830. +
  831. switch($this->Mailer) {
  832. +
  833. case 'sendmail':
  834. +
  835. $result = $this->SendmailSend($header, $body);
  836. +
  837. break;
  838. +
  839. case 'smtp':
  840. +
  841. $result = $this->SmtpSend($header, $body);
  842. +
  843. break;
  844. +
  845. case 'mail':
  846. +
  847. $result = $this->MailSend($header, $body);
  848. +
  849. break;
  850. +
  851. default:
  852. +
  853. $result = $this->MailSend($header, $body);
  854. +
  855. break;
  856. +
  857. //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
  858. +
  859. //$result = false;
  860. +
  861. //break;
  862. +
  863. }
  864. +
  865.  
  866. +
  867. return $result;
  868. +
  869. }
  870. +
  871.  
  872. +
  873. /**
  874. +
  875. * Sends mail using the $Sendmail program.
  876. +
  877. * @access private
  878. +
  879. * @return bool
  880. +
  881. */
  882. +
  883. function SendmailSend($header, $body) {
  884. +
  885. if ($this->Sender != '') {
  886. +
  887. $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
  888. +
  889. } else {
  890. +
  891. $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
  892. +
  893. }
  894. +
  895.  
  896. +
  897. if(!@$mail = popen($sendmail, 'w')) {
  898. +
  899. $this->SetError($this->Lang('execute') . $this->Sendmail);
  900. +
  901. return false;
  902. +
  903. }
  904. +
  905.  
  906. +
  907. fputs($mail, $header);
  908. +
  909. fputs($mail, $body);
  910. +
  911.  
  912. +
  913. $result = pclose($mail);
  914. +
  915. if (version_compare(phpversion(), '4.2.3') == -1) {
  916. +
  917. $result = $result >> 8 & 0xFF;
  918. +
  919. }
  920. +
  921. if($result != 0) {
  922. +
  923. $this->SetError($this->Lang('execute') . $this->Sendmail);
  924. +
  925. return false;
  926. +
  927. }
  928. +
  929. return true;
  930. +
  931. }
  932. +
  933.  
  934. +
  935. /**
  936. +
  937. * Sends mail using the PHP mail() function.
  938. +
  939. * @access private
  940. +
  941. * @return bool
  942. +
  943. */
  944. +
  945. function MailSend($header, $body) {
  946. +
  947.  
  948. +
  949. $to = '';
  950. +
  951. for($i = 0; $i < count($this->to); $i++) {
  952. +
  953. if($i != 0) { $to .= ', '; }
  954. +
  955. $to .= $this->AddrFormat($this->to[$i]);
  956. +
  957. }
  958. +
  959.  
  960. +
  961. $toArr = split(',', $to);
  962. +
  963.  
  964. +
  965. $params = sprintf("-oi -f %s", $this->Sender);
  966. +
  967. if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
  968. +
  969. $old_from = ini_get('sendmail_from');
  970. +
  971. ini_set('sendmail_from', $this->Sender);
  972. +
  973. if ($this->SingleTo === true && count($toArr) > 1) {
  974. +
  975. foreach ($toArr as $key => $val) {
  976. +
  977. $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
  978. +
  979. }
  980. +
  981. } else {
  982. +
  983. $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
  984. +
  985. }
  986. +
  987. } else {
  988. +
  989. if ($this->SingleTo === true && count($toArr) > 1) {
  990. +
  991. foreach ($toArr as $key => $val) {
  992. +
  993. $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
  994. +
  995. }
  996. +
  997. } else {
  998. +
  999. $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
  1000. +
  1001. }
  1002. +
  1003. }
  1004. +
  1005.  
  1006. +
  1007. if (isset($old_from)) {
  1008. +
  1009. ini_set('sendmail_from', $old_from);
  1010. +
  1011. }
  1012. +
  1013.  
  1014. +
  1015. if(!$rt) {
  1016. +
  1017. $this->SetError($this->Lang('instantiate'));
  1018. +
  1019. return false;
  1020. +
  1021. }
  1022. +
  1023.  
  1024. +
  1025. return true;
  1026. +
  1027. }
  1028. +
  1029.  
  1030. +
  1031. /**
  1032. +
  1033. * Sends mail via SMTP using PhpSMTP (Author:
  1034. +
  1035. * Chris Ryan). Returns bool. Returns false if there is a
  1036. +
  1037. * bad MAIL FROM, RCPT, or DATA input.
  1038. +
  1039. * @access private
  1040. +
  1041. * @return bool
  1042. +
  1043. */
  1044. +
  1045. function SmtpSend($header, $body) {
  1046. +
  1047. include_once($this->PluginDir . 'class.smtp.php');
  1048. +
  1049. $error = '';
  1050. +
  1051. $bad_rcpt = array();
  1052. +
  1053.  
  1054. +
  1055. if(!$this->SmtpConnect()) {
  1056. +
  1057. return false;
  1058. +
  1059. }
  1060. +
  1061.  
  1062. +
  1063. $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
  1064. +
  1065. if(!$this->smtp->Mail($smtp_from)) {
  1066. +
  1067. $error = $this->Lang('from_failed') . $smtp_from;
  1068. +
  1069. $this->SetError($error);
  1070. +
  1071. $this->smtp->Reset();
  1072. +
  1073. return false;
  1074. +
  1075. }
  1076. +
  1077.  
  1078. +
  1079. /* Attempt to send attach all recipients */
  1080. +
  1081. for($i = 0; $i < count($this->to); $i++) {
  1082. +
  1083. if(!$this->smtp->Recipient($this->to[$i][0])) {
  1084. +
  1085. $bad_rcpt[] = $this->to[$i][0];
  1086. +
  1087. }
  1088. +
  1089. }
  1090. +
  1091. for($i = 0; $i < count($this->cc); $i++) {
  1092. +
  1093. if(!$this->smtp->Recipient($this->cc[$i][0])) {
  1094. +
  1095. $bad_rcpt[] = $this->cc[$i][0];
  1096. +
  1097. }
  1098. +
  1099. }
  1100. +
  1101. for($i = 0; $i < count($this->bcc); $i++) {
  1102. +
  1103. if(!$this->smtp->Recipient($this->bcc[$i][0])) {
  1104. +
  1105. $bad_rcpt[] = $this->bcc[$i][0];
  1106. +
  1107. }
  1108. +
  1109. }
  1110. +
  1111.  
  1112. +
  1113. if(count($bad_rcpt) > 0) { // Create error message
  1114. +
  1115. for($i = 0; $i < count($bad_rcpt); $i++) {
  1116. +
  1117. if($i != 0) {
  1118. +
  1119. $error .= ', ';
  1120. +
  1121. }
  1122. +
  1123. $error .= $bad_rcpt[$i];
  1124. +
  1125. }
  1126. +
  1127. $error = $this->Lang('recipients_failed') . $error;
  1128. +
  1129. $this->SetError($error);
  1130. +
  1131. $this->smtp->Reset();
  1132. +
  1133. return false;
  1134. +
  1135. }
  1136. +
  1137.  
  1138. +
  1139. if(!$this->smtp->Data($header . $body)) {
  1140. +
  1141. $this->SetError($this->Lang('data_not_accepted'));
  1142. +
  1143. $this->smtp->Reset();
  1144. +
  1145. return false;
  1146. +
  1147. }
  1148. +
  1149. if($this->SMTPKeepAlive == true) {
  1150. +
  1151. $this->smtp->Reset();
  1152. +
  1153. } else {
  1154. +
  1155. $this->SmtpClose();
  1156. +
  1157. }
  1158. +
  1159.  
  1160. +
  1161. return true;
  1162. +
  1163. }
  1164. +
  1165.  
  1166. +
  1167. /**
  1168. +
  1169. * Initiates a connection to an SMTP server. Returns false if the
  1170. +
  1171. * operation failed.
  1172. +
  1173. * @access private
  1174. +
  1175. * @return bool
  1176. +
  1177. */
  1178. +
  1179. function SmtpConnect() {
  1180. +
  1181. if($this->smtp == NULL) {
  1182. +
  1183. $this->smtp = new SMTP();
  1184. +
  1185. }
  1186. +
  1187.  
  1188. +
  1189. $this->smtp->do_debug = $this->SMTPDebug;
  1190. +
  1191. $hosts = explode(';', $this->Host);
  1192. +
  1193. $index = 0;
  1194. +
  1195. $connection = ($this->smtp->Connected());
  1196. +
  1197.  
  1198. +
  1199. /* Retry while there is no connection */
  1200. +
  1201. while($index < count($hosts) && $connection == false) {
  1202. +
  1203. $hostinfo = array();
  1204. +
  1205. if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
  1206. +
  1207. $host = $hostinfo[1];
  1208. +
  1209. $port = $hostinfo[2];
  1210. +
  1211. } else {
  1212. +
  1213. $host = $hosts[$index];
  1214. +
  1215. $port = $this->Port;
  1216. +
  1217. }
  1218. +
  1219.  
  1220. +
  1221. if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
  1222. +
  1223. if ($this->Helo != '') {
  1224. +
  1225. $this->smtp->Hello($this->Helo);
  1226. +
  1227. } else {
  1228. +
  1229. $this->smtp->Hello($this->ServerHostname());
  1230. +
  1231. }
  1232. +
  1233.  
  1234. +
  1235. $connection = true;
  1236. +
  1237. if($this->SMTPAuth) {
  1238. +
  1239. if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
  1240. +
  1241. $this->SetError($this->Lang('authenticate'));
  1242. +
  1243. $this->smtp->Reset();
  1244. +
  1245. $connection = false;
  1246. +
  1247. }
  1248. +
  1249. }
  1250. +
  1251. }
  1252. +
  1253. $index++;
  1254. +
  1255. }
  1256. +
  1257. if(!$connection) {
  1258. +
  1259. $this->SetError($this->Lang('connect_host'));
  1260. +
  1261. }
  1262. +
  1263.  
  1264. +
  1265. return $connection;
  1266. +
  1267. }
  1268. +
  1269.  
  1270. +
  1271. /**
  1272. +
  1273. * Closes the active SMTP session if one exists.
  1274. +
  1275. * @return void
  1276. +
  1277. */
  1278. +
  1279. function SmtpClose() {
  1280. +
  1281. if($this->smtp != NULL) {
  1282. +
  1283. if($this->smtp->Connected()) {
  1284. +
  1285. $this->smtp->Quit();
  1286. +
  1287. $this->smtp->Close();
  1288. +
  1289. }
  1290. +
  1291. }
  1292. +
  1293. }
  1294. +
  1295.  
  1296. +
  1297. /**
  1298. +
  1299. * Sets the language for all class error messages. Returns false
  1300. +
  1301. * if it cannot load the language file. The default language type
  1302. +
  1303. * is English.
  1304. +
  1305. * @param string $lang_type Type of language (e.g. Portuguese: "br")
  1306. +
  1307. * @param string $lang_path Path to the language file directory
  1308. +
  1309. * @access public
  1310. +
  1311. * @return bool
  1312. +
  1313. */
  1314. +
  1315. function SetLanguage($lang_type, $lang_path = 'language/') {
  1316. +
  1317. if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
  1318. +
  1319. include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
  1320. +
  1321. } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
  1322. +
  1323. include($lang_path.'phpmailer.lang-en.php');
  1324. +
  1325. } else {
  1326. +
  1327. $PHPMAILER_LANG = array();
  1328. +
  1329. $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
  1330. +
  1331. $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
  1332. +
  1333. $PHPMAILER_LANG["execute"] = 'Could not execute: ';
  1334. +
  1335. $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
  1336. +
  1337. $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
  1338. +
  1339. $PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
  1340. +
  1341. $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
  1342. +
  1343. $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
  1344. +
  1345. $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
  1346. +
  1347. $PHPMAILER_LANG["file_access"] = 'Could not access file: ';
  1348. +
  1349. $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
  1350. +
  1351. $PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
  1352. +
  1353. $PHPMAILER_LANG["signing"] = 'Signing Error: ';
  1354. +
  1355. }
  1356. +
  1357. $this->language = $PHPMAILER_LANG;
  1358. +
  1359.  
  1360. +
  1361. return true;
  1362. +
  1363. }
  1364. +
  1365.  
  1366. +
  1367. /////////////////////////////////////////////////
  1368. +
  1369. // METHODS, MESSAGE CREATION
  1370. +
  1371. /////////////////////////////////////////////////
  1372. +
  1373.  
  1374. +
  1375. +
  1376.  
  1377. +
  1378. /**
  1379. +
  1380. * Creates recipient headers.
  1381. +
  1382. * @access private
  1383. +
  1384. * @return string
  1385. +
  1386. */
  1387. +
  1388. function AddrAppend($type, $addr) {
  1389. +
  1390. $addr_str = $type . ': ';
  1391. +
  1392. $addr_str .= $this->AddrFormat($addr[0]);
  1393. +
  1394. if(count($addr) > 1) {
  1395. +
  1396. for($i = 1; $i < count($addr); $i++) {
  1397. +
  1398. $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
  1399. +
  1400. }
  1401. +
  1402. }
  1403. +
  1404. $addr_str .= $this->LE;
  1405. +
  1406.  
  1407. +
  1408. return $addr_str;
  1409. +
  1410. }
  1411. +
  1412.  
  1413. +
  1414. /**
  1415. +
  1416. * Formats an address correctly.
  1417. +
  1418. * @access private
  1419. +
  1420. * @return string
  1421. +
  1422. */
  1423. +
  1424. function AddrFormat($addr) {
  1425. +
  1426. if(empty($addr[1])) {
  1427. +
  1428. $formatted = $this->SecureHeader($addr[0]);
  1429. +
  1430. } else {
  1431. +
  1432. $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
  1433. +
  1434. }
  1435. +
  1436.  
  1437. +
  1438. return $formatted;
  1439. +
  1440. }
  1441. +
  1442.  
  1443. +
  1444. /**
  1445. +
  1446. * Wraps message for use with mailers that do not
  1447. +
  1448. * automatically perform wrapping and for quoted-printable.
  1449. +
  1450. * Original written by philippe.
  1451. +
  1452. * @access private
  1453. +
  1454. * @return string
  1455. +
  1456. */
  1457. +
  1458. function WrapText($message, $length, $qp_mode = false) {
  1459. +
  1460. $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
  1461. +
  1462. // If utf-8 encoding is used, we will need to make sure we don't
  1463. +
  1464. // split multibyte characters when we wrap
  1465. +
  1466. $is_utf8 = (strtolower($this->CharSet) == "utf-8");
  1467. +
  1468.  
  1469. +
  1470. $message = $this->FixEOL($message);
  1471. +
  1472. if (substr($message, -1) == $this->LE) {
  1473. +
  1474. $message = substr($message, 0, -1);
  1475. +
  1476. }
  1477. +
  1478.  
  1479. +
  1480. $line = explode($this->LE, $message);
  1481. +
  1482. $message = '';
  1483. +
  1484. for ($i=0 ;$i < count($line); $i++) {
  1485. +
  1486. $line_part = explode(' ', $line[$i]);
  1487. +
  1488. $buf = '';
  1489. +
  1490. for ($e = 0; $e<count($line_part); $e++) {
  1491. +
  1492. $word = $line_part[$e];
  1493. +
  1494. if ($qp_mode and (strlen($word) > $length)) {
  1495. +
  1496. $space_left = $length - strlen($buf) - 1;
  1497. +
  1498. if ($e != 0) {
  1499. +
  1500. if ($space_left > 20) {
  1501. +
  1502. $len = $space_left;
  1503. +
  1504. if ($is_utf8) {
  1505. +
  1506. $len = $this->UTF8CharBoundary($word, $len);
  1507. +
  1508. } elseif (substr($word, $len - 1, 1) == "=") {
  1509. +
  1510. $len--;
  1511. +
  1512. } elseif (substr($word, $len - 2, 1) == "=") {
  1513. +
  1514. $len -= 2;
  1515. +
  1516. }
  1517. +
  1518. $part = substr($word, 0, $len);
  1519. +
  1520. $word = substr($word, $len);
  1521. +
  1522. $buf .= ' ' . $part;
  1523. +
  1524. $message .= $buf . sprintf("=%s", $this->LE);
  1525. +
  1526. } else {
  1527. +
  1528. $message .= $buf . $soft_break;
  1529. +
  1530. }
  1531. +
  1532. $buf = '';
  1533. +
  1534. }
  1535. +
  1536. while (strlen($word) > 0) {
  1537. +
  1538. $len = $length;
  1539. +
  1540. if ($is_utf8) {
  1541. +
  1542. $len = $this->UTF8CharBoundary($word, $len);
  1543. +
  1544. } elseif (substr($word, $len - 1, 1) == "=") {
  1545. +
  1546. $len--;
  1547. +
  1548. } elseif (substr($word, $len - 2, 1) == "=") {
  1549. +
  1550. $len -= 2;
  1551. +
  1552. }
  1553. +
  1554. $part = substr($word, 0, $len);
  1555. +
  1556. $word = substr($word, $len);
  1557. +
  1558.  
  1559. +
  1560. if (strlen($word) > 0) {
  1561. +
  1562. $message .= $part . sprintf("=%s", $this->LE);
  1563. +
  1564. } else {
  1565. +
  1566. $buf = $part;
  1567. +
  1568. }
  1569. +
  1570. }
  1571. +
  1572. } else {
  1573. +
  1574. $buf_o = $buf;
  1575. +
  1576. $buf .= ($e == 0) ? $word : (' ' . $word);
  1577. +
  1578.  
  1579. +
  1580. if (strlen($buf) > $length and $buf_o != '') {
  1581. +
  1582. $message .= $buf_o . $soft_break;
  1583. +
  1584. $buf = $word;
  1585. +
  1586. }
  1587. +
  1588. }
  1589. +
  1590. }
  1591. +
  1592. $message .= $buf . $this->LE;
  1593. +
  1594. }
  1595. +
  1596.  
  1597. +
  1598. return $message;
  1599. +
  1600. }
  1601. +
  1602.  
  1603. +
  1604. /**
  1605. +
  1606. * Finds last character boundary prior to maxLength in a utf-8
  1607. +
  1608. * quoted (printable) encoded string.
  1609. +
  1610. * Original written by Colin Brown.
  1611. +
  1612. * @access private
  1613. +
  1614. * @param string $encodedText utf-8 QP text
  1615. +
  1616. * @param int $maxLength find last character boundary prior to this length
  1617. +
  1618. * @return int
  1619. +
  1620. */
  1621. +
  1622. function UTF8CharBoundary($encodedText, $maxLength) {
  1623. +
  1624. $foundSplitPos = false;
  1625. +
  1626. $lookBack = 3;
  1627. +
  1628. while (!$foundSplitPos) {
  1629. +
  1630. $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
  1631. +
  1632. $encodedCharPos = strpos($lastChunk, "=");
  1633. +
  1634. if ($encodedCharPos !== false) {
  1635. +
  1636. // Found start of encoded character byte within $lookBack block.
  1637. +
  1638. // Check the encoded byte value (the 2 chars after the '=')
  1639. +
  1640. $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
  1641. +
  1642. $dec = hexdec($hex);
  1643. +
  1644. if ($dec < 128) { // Single byte character.
  1645. +
  1646. // If the encoded char was found at pos 0, it will fit
  1647. +
  1648. // otherwise reduce maxLength to start of the encoded char
  1649. +
  1650. $maxLength = ($encodedCharPos == 0) ? $maxLength :
  1651. +
  1652. $maxLength - ($lookBack - $encodedCharPos);
  1653. +
  1654. $foundSplitPos = true;
  1655. +
  1656. } elseif ($dec >= 192) { // First byte of a multi byte character
  1657. +
  1658. // Reduce maxLength to split at start of character
  1659. +
  1660. $maxLength = $maxLength - ($lookBack - $encodedCharPos);
  1661. +
  1662. $foundSplitPos = true;
  1663. +
  1664. } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
  1665. +
  1666. $lookBack += 3;
  1667. +
  1668. }
  1669. +
  1670. } else {
  1671. +
  1672. // No encoded character found
  1673. +
  1674. $foundSplitPos = true;
  1675. +
  1676. }
  1677. +
  1678. }
  1679. +
  1680. return $maxLength;
  1681. +
  1682. }
  1683. +
  1684.  
  1685. +
  1686. /**
  1687. +
  1688. * Set the body wrapping.
  1689. +
  1690. * @access private
  1691. +
  1692. * @return void
  1693. +
  1694. */
  1695. +
  1696. function SetWordWrap() {
  1697. +
  1698. if($this->WordWrap < 1) {
  1699. +
  1700. return;
  1701. +
  1702. }
  1703. +
  1704.  
  1705. +
  1706. switch($this->message_type) {
  1707. +
  1708. case 'alt':
  1709. +
  1710. /* fall through */
  1711. +
  1712. case 'alt_attachments':
  1713. +
  1714. $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
  1715. +
  1716. break;
  1717. +
  1718. default:
  1719. +
  1720. $this->Body = $this->WrapText($this->Body, $this->WordWrap);
  1721. +
  1722. break;
  1723. +
  1724. }
  1725. +
  1726. }
  1727. +
  1728.  
  1729. +
  1730. /**
  1731. +
  1732. * Assembles message header.
  1733. +
  1734. * @access private
  1735. +
  1736. * @return string
  1737. +
  1738. */
  1739. +
  1740. function CreateHeader() {
  1741. +
  1742. $result = '';
  1743. +
  1744.  
  1745. +
  1746. /* Set the boundaries */
  1747. +
  1748. $uniq_id = md5(uniqid(time()));
  1749. +
  1750. $this->boundary[1] = 'b1_' . $uniq_id;
  1751. +
  1752. $this->boundary[2] = 'b2_' . $uniq_id;
  1753. +
  1754.  
  1755. +
  1756. $result .= $this->HeaderLine('Date', $this->RFCDate());
  1757. +
  1758. if($this->Sender == '') {
  1759. +
  1760. $result .= $this->HeaderLine('Return-Path', trim($this->From));
  1761. +
  1762. } else {
  1763. +
  1764. $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
  1765. +
  1766. }
  1767. +
  1768.  
  1769. +
  1770. /* To be created automatically by mail() */
  1771. +
  1772. if($this->Mailer != 'mail') {
  1773. +
  1774. if(count($this->to) > 0) {
  1775. +
  1776. $result .= $this->AddrAppend('To', $this->to);
  1777. +
  1778. } elseif (count($this->cc) == 0) {
  1779. +
  1780. $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
  1781. +
  1782. }
  1783. +
  1784. }
  1785. +
  1786.  
  1787. +
  1788. $from = array();
  1789. +
  1790. $from[0][0] = trim($this->From);
  1791. +
  1792. $from[0][1] = $this->FromName;
  1793. +
  1794. $result .= $this->AddrAppend('From', $from);
  1795. +
  1796.  
  1797. +
  1798. /* sendmail and mail() extract Cc from the header before sending */
  1799. +
  1800. if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
  1801. +
  1802. $result .= $this->AddrAppend('Cc', $this->cc);
  1803. +
  1804. }
  1805. +
  1806.  
  1807. +
  1808. /* sendmail and mail() extract Bcc from the header before sending */
  1809. +
  1810. if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
  1811. +
  1812. $result .= $this->AddrAppend('Bcc', $this->bcc);
  1813. +
  1814. }
  1815. +
  1816.  
  1817. +
  1818. if(count($this->ReplyTo) > 0) {
  1819. +
  1820. $result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
  1821. +
  1822. }
  1823. +
  1824.  
  1825. +
  1826. /* mail() sets the subject itself */
  1827. +
  1828. if($this->Mailer != 'mail') {
  1829. +
  1830. $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
  1831. +
  1832. }
  1833. +
  1834.  
  1835. +
  1836. if($this->MessageID != '') {
  1837. +
  1838. $result .= $this->HeaderLine('Message-ID',$this->MessageID);
  1839. +
  1840. } else {
  1841. +
  1842. $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
  1843. +
  1844. }
  1845. +
  1846. $result .= $this->HeaderLine('X-Priority', $this->Priority);
  1847. +
  1848. $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']');
  1849. +
  1850.  
  1851. +
  1852. if($this->ConfirmReadingTo != '') {
  1853. +
  1854. $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
  1855. +
  1856. }
  1857. +
  1858.  
  1859. +
  1860. // Add custom headers
  1861. +
  1862. for($index = 0; $index < count($this->CustomHeader); $index++) {
  1863. +
  1864. $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
  1865. +
  1866. }
  1867. +
  1868. if (!$this->sign_key_file) {
  1869. +
  1870. $result .= $this->HeaderLine('MIME-Version', '1.0');
  1871. +
  1872. $result .= $this->GetMailMIME();
  1873. +
  1874. }
  1875. +
  1876.  
  1877. +
  1878. return $result;
  1879. +
  1880. }
  1881. +
  1882.  
  1883. +
  1884. /**
  1885. +
  1886. * Returns the message MIME.
  1887. +
  1888. * @access private
  1889. +
  1890. * @return string
  1891. +
  1892. */
  1893. +
  1894. function GetMailMIME() {
  1895. +
  1896. $result = '';
  1897. +
  1898. switch($this->message_type) {
  1899. +
  1900. case 'plain':
  1901. +
  1902. $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
  1903. +
  1904. $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
  1905. +
  1906. break;
  1907. +
  1908. case 'attachments':
  1909. +
  1910. /* fall through */
  1911. +
  1912. case 'alt_attachments':
  1913. +
  1914. if($this->InlineImageExists()){
  1915. +
  1916. $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
  1917. +
  1918. } else {
  1919. +
  1920. $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
  1921. +
  1922. $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
  1923. +
  1924. }
  1925. +
  1926. break;
  1927. +
  1928. case 'alt':
  1929. +
  1930. $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
  1931. +
  1932. $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
  1933. +
  1934. break;
  1935. +
  1936. }
  1937. +
  1938.  
  1939. +
  1940. if($this->Mailer != 'mail') {
  1941. +
  1942. $result .= $this->LE.$this->LE;
  1943. +
  1944. }
  1945. +
  1946.  
  1947. +
  1948. return $result;
  1949. +
  1950. }
  1951. +
  1952.  
  1953. +
  1954. /**
  1955. +
  1956. * Assembles the message body. Returns an empty string on failure.
  1957. +
  1958. * @access private
  1959. +
  1960. * @return string
  1961. +
  1962. */
  1963. +
  1964. function CreateBody() {
  1965. +
  1966. $result = '';
  1967. +
  1968. if ($this->sign_key_file) {
  1969. +
  1970. $result .= $this->GetMailMIME();
  1971. +
  1972. }
  1973. +
  1974.  
  1975. +
  1976. $this->SetWordWrap();
  1977. +
  1978.  
  1979. +
  1980. switch($this->message_type) {
  1981. +
  1982. case 'alt':
  1983. +
  1984. $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
  1985. +
  1986. $result .= $this->EncodeString($this->AltBody, $this->Encoding);
  1987. +
  1988. $result .= $this->LE.$this->LE;
  1989. +
  1990. $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
  1991. +
  1992. $result .= $this->EncodeString($this->Body, $this->Encoding);
  1993. +
  1994. $result .= $this->LE.$this->LE;
  1995. +
  1996. $result .= $this->EndBoundary($this->boundary[1]);
  1997. +
  1998. break;
  1999. +
  2000. case 'plain':
  2001. +
  2002. $result .= $this->EncodeString($this->Body, $this->Encoding);
  2003. +
  2004. break;
  2005. +
  2006. case 'attachments':
  2007. +
  2008. $result .= $this->GetBoundary($this->boundary[1], '', '', '');
  2009. +
  2010. $result .= $this->EncodeString($this->Body, $this->Encoding);
  2011. +
  2012. $result .= $this->LE;
  2013. +
  2014. $result .= $this->AttachAll();
  2015. +
  2016. break;
  2017. +
  2018. case 'alt_attachments':
  2019. +
  2020. $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
  2021. +
  2022. $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
  2023. +
  2024. $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
  2025. +
  2026. $result .= $this->EncodeString($this->AltBody, $this->Encoding);
  2027. +
  2028. $result .= $this->LE.$this->LE;
  2029. +
  2030. $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
  2031. +
  2032. $result .= $this->EncodeString($this->Body, $this->Encoding);
  2033. +
  2034. $result .= $this->LE.$this->LE;
  2035. +
  2036. $result .= $this->EndBoundary($this->boundary[2]);
  2037. +
  2038. $result .= $this->AttachAll();
  2039. +
  2040. break;
  2041. +
  2042. }
  2043. +
  2044.  
  2045. +
  2046. if($this->IsError()) {
  2047. +
  2048. $result = '';
  2049. +
  2050. } else if ($this->sign_key_file) {
  2051. +
  2052. $file = tempnam("", "mail");
  2053. +
  2054. $fp = fopen($file, "w");
  2055. +
  2056. fwrite($fp, $result);
  2057. +
  2058. fclose($fp);
  2059. +
  2060. $signed = tempnam("", "signed");
  2061. +
  2062.  
  2063. +
  2064. if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
  2065. +
  2066. $fp = fopen($signed, "r");
  2067. +
  2068. $result = fread($fp, filesize($this->sign_key_file));
  2069. +
  2070. $result = '';
  2071. +
  2072. while(!feof($fp)){
  2073. +
  2074. $result = $result . fread($fp, 1024);
  2075. +
  2076. }
  2077. +
  2078. fclose($fp);
  2079. +
  2080. } else {
  2081. +
  2082. $this->SetError($this->Lang("signing").openssl_error_string());
  2083. +
  2084. $result = '';
  2085. +
  2086. }
  2087. +
  2088.  
  2089. +
  2090. unlink($file);
  2091. +
  2092. unlink($signed);
  2093. +
  2094. }
  2095. +
  2096.  
  2097. +
  2098. return $result;
  2099. +
  2100. }
  2101. +
  2102.  
  2103. +
  2104. /**
  2105. +
  2106. * Returns the start of a message boundary.
  2107. +
  2108. * @access private
  2109. +
  2110. */
  2111. +
  2112. function GetBoundary($boundary, $charSet, $contentType, $encoding) {
  2113. +
  2114. $result = '';
  2115. +
  2116. if($charSet == '') {
  2117. +
  2118. $charSet = $this->CharSet;
  2119. +
  2120. }
  2121. +
  2122. if($contentType == '') {
  2123. +
  2124. $contentType = $this->ContentType;
  2125. +
  2126. }
  2127. +
  2128. if($encoding == '') {
  2129. +
  2130. $encoding = $this->Encoding;
  2131. +
  2132. }
  2133. +
  2134. $result .= $this->TextLine('--' . $boundary);
  2135. +
  2136. $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
  2137. +
  2138. $result .= $this->LE;
  2139. +
  2140. $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
  2141. +
  2142. $result .= $this->LE;
  2143. +
  2144.  
  2145. +
  2146. return $result;
  2147. +
  2148. }
  2149. +
  2150.  
  2151. +
  2152. /**
  2153. +
  2154. * Returns the end of a message boundary.
  2155. +
  2156. * @access private
  2157. +
  2158. */
  2159. +
  2160. function EndBoundary($boundary) {
  2161. +
  2162. return $this->LE . '--' . $boundary . '--' . $this->LE;
  2163. +
  2164. }
  2165. +
  2166.  
  2167. +
  2168. /**
  2169. +
  2170. * Sets the message type.
  2171. +
  2172. * @access private
  2173. +
  2174. * @return void
  2175. +
  2176. */
  2177. +
  2178. function SetMessageType() {
  2179. +
  2180. if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
  2181. +
  2182. $this->message_type = 'plain';
  2183. +
  2184. } else {
  2185. +
  2186. if(count($this->attachment) > 0) {
  2187. +
  2188. $this->message_type = 'attachments';
  2189. +
  2190. }
  2191. +
  2192. if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
  2193. +
  2194. $this->message_type = 'alt';
  2195. +
  2196. }
  2197. +
  2198. if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
  2199. +
  2200. $this->message_type = 'alt_attachments';
  2201. +
  2202. }
  2203. +
  2204. }
  2205. +
  2206. }
  2207. +
  2208.  
  2209. +
  2210. /* Returns a formatted header line.
  2211. +
  2212. * @access private
  2213. +
  2214. * @return string
  2215. +
  2216. */
  2217. +
  2218. function HeaderLine($name, $value) {
  2219. +
  2220. return $name . ': ' . $value . $this->LE;
  2221. +
  2222. }
  2223. +
  2224.  
  2225. +
  2226. /**
  2227. +
  2228. * Returns a formatted mail line.
  2229. +
  2230. * @access private
  2231. +
  2232. * @return string
  2233. +
  2234. */
  2235. +
  2236. function TextLine($value) {
  2237. +
  2238. return $value . $this->LE;
  2239. +
  2240. }
  2241. +
  2242.  
  2243. +
  2244. /////////////////////////////////////////////////
  2245. +
  2246. // CLASS METHODS, ATTACHMENTS
  2247. +
  2248. /////////////////////////////////////////////////
  2249. +
  2250.  
  2251. +
  2252. +
  2253.  
  2254. +
  2255. /**
  2256. +
  2257. * Adds an attachment from a path on the filesystem.
  2258. +
  2259. * Returns false if the file could not be found
  2260. +
  2261. * or accessed.
  2262. +
  2263. * @param string $path Path to the attachment.
  2264. +
  2265. * @param string $name Overrides the attachment name.
  2266. +
  2267. * @param string $encoding File encoding (see $Encoding).
  2268. +
  2269. * @param string $type File extension (MIME) type.
  2270. +
  2271. * @return bool
  2272. +
  2273. */
  2274. +
  2275. function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
  2276. +
  2277. if(!@is_file($path)) {
  2278. +
  2279. $this->SetError($this->Lang('file_access') . $path);
  2280. +
  2281. return false;
  2282. +
  2283. }
  2284. +
  2285.  
  2286. +
  2287. $filename = basename($path);
  2288. +
  2289. if($name == '') {
  2290. +
  2291. $name = $filename;
  2292. +
  2293. }
  2294. +
  2295.  
  2296. +
  2297. $cur = count($this->attachment);
  2298. +
  2299. $this->attachment[$cur][0] = $path;
  2300. +
  2301. $this->attachment[$cur][1] = $filename;
  2302. +
  2303. $this->attachment[$cur][2] = $name;
  2304. +
  2305. $this->attachment[$cur][3] = $encoding;
  2306. +
  2307. $this->attachment[$cur][4] = $type;
  2308. +
  2309. $this->attachment[$cur][5] = false; // isStringAttachment
  2310. +
  2311. $this->attachment[$cur][6] = 'attachment';
  2312. +
  2313. $this->attachment[$cur][7] = 0;
  2314. +
  2315.  
  2316. +
  2317. return true;
  2318. +
  2319. }
  2320. +
  2321.  
  2322. +
  2323. /**
  2324. +
  2325. * Attaches all fs, string, and binary attachments to the message.
  2326. +
  2327. * Returns an empty string on failure.
  2328. +
  2329. * @access private
  2330. +
  2331. * @return string
  2332. +
  2333. */
  2334. +
  2335. function AttachAll() {
  2336. +
  2337. /* Return text of body */
  2338. +
  2339. $mime = array();
  2340. +
  2341.  
  2342. +
  2343. /* Add all attachments */
  2344. +
  2345. for($i = 0; $i < count($this->attachment); $i++) {
  2346. +
  2347. /* Check for string attachment */
  2348. +
  2349. $bString = $this->attachment[$i][5];
  2350. +
  2351. if ($bString) {
  2352. +
  2353. $string = $this->attachment[$i][0];
  2354. +
  2355. } else {
  2356. +
  2357. $path = $this->attachment[$i][0];
  2358. +
  2359. }
  2360. +
  2361.  
  2362. +
  2363. $filename = $this->attachment[$i][1];
  2364. +
  2365. $name = $this->attachment[$i][2];
  2366. +
  2367. $encoding = $this->attachment[$i][3];
  2368. +
  2369. $type = $this->attachment[$i][4];
  2370. +
  2371. $disposition = $this->attachment[$i][6];
  2372. +
  2373. $cid = $this->attachment[$i][7];
  2374. +
  2375.  
  2376. +
  2377. $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
  2378. +
  2379. $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
  2380. +
  2381. $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
  2382. +
  2383.  
  2384. +
  2385. if($disposition == 'inline') {
  2386. +
  2387. $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
  2388. +
  2389. }
  2390. +
  2391.  
  2392. +
  2393. $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
  2394. +
  2395.  
  2396. +
  2397. /* Encode as string attachment */
  2398. +
  2399. if($bString) {
  2400. +
  2401. $mime[] = $this->EncodeString($string, $encoding);
  2402. +
  2403. if($this->IsError()) {
  2404. +
  2405. return '';
  2406. +
  2407. }
  2408. +
  2409. $mime[] = $this->LE.$this->LE;
  2410. +
  2411. } else {
  2412. +
  2413. $mime[] = $this->EncodeFile($path, $encoding);
  2414. +
  2415. if($this->IsError()) {
  2416. +
  2417. return '';
  2418. +
  2419. }
  2420. +
  2421. $mime[] = $this->LE.$this->LE;
  2422. +
  2423. }
  2424. +
  2425. }
  2426. +
  2427.  
  2428. +
  2429. $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
  2430. +
  2431.  
  2432. +
  2433. return join('', $mime);
  2434. +
  2435. }
  2436. +
  2437.  
  2438. +
  2439. /**
  2440. +
  2441. * Encodes attachment in requested format. Returns an
  2442. +
  2443. * empty string on failure.
  2444. +
  2445. * @access private
  2446. +
  2447. * @return string
  2448. +
  2449. */
  2450. +
  2451. function EncodeFile ($path, $encoding = 'base64') {
  2452. +
  2453. if(!@$fd = fopen($path, 'rb')) {
  2454. +
  2455. $this->SetError($this->Lang('file_open') . $path);
  2456. +
  2457. return '';
  2458. +
  2459. }
  2460. +
  2461. $magic_quotes = get_magic_quotes_runtime();
  2462. +
  2463. set_magic_quotes_runtime(0);
  2464. +
  2465. $file_buffer = fread($fd, filesize($path));
  2466. +
  2467. $file_buffer = $this->EncodeString($file_buffer, $encoding);
  2468. +
  2469. fclose($fd);
  2470. +
  2471. set_magic_quotes_runtime($magic_quotes);
  2472. +
  2473.  
  2474. +
  2475. return $file_buffer;
  2476. +
  2477. }
  2478. +
  2479.  
  2480. +
  2481. /**
  2482. +
  2483. * Encodes string to requested format. Returns an
  2484. +
  2485. * empty string on failure.
  2486. +
  2487. * @access private
  2488. +
  2489. * @return string
  2490. +
  2491. */
  2492. +
  2493. function EncodeString ($str, $encoding = 'base64') {
  2494. +
  2495. $encoded = '';
  2496. +
  2497. switch(strtolower($encoding)) {
  2498. +
  2499. case 'base64':
  2500. +
  2501. /* chunk_split is found in PHP >= 3.0.6 */
  2502. +
  2503. $encoded = chunk_split(base64_encode($str), 76, $this->LE);
  2504. +
  2505. break;
  2506. +
  2507. case '7bit':
  2508. +
  2509. case '8bit':
  2510. +
  2511. $encoded = $this->FixEOL($str);
  2512. +
  2513. if (substr($encoded, -(strlen($this->LE))) != $this->LE)
  2514. +
  2515. $encoded .= $this->LE;
  2516. +
  2517. break;
  2518. +
  2519. case 'binary':
  2520. +
  2521. $encoded = $str;
  2522. +
  2523. break;
  2524. +
  2525. case 'quoted-printable':
  2526. +
  2527. $encoded = $this->EncodeQP($str);
  2528. +
  2529. break;
  2530. +
  2531. default:
  2532. +
  2533. $this->SetError($this->Lang('encoding') . $encoding);
  2534. +
  2535. break;
  2536. +
  2537. }
  2538. +
  2539. return $encoded;
  2540. +
  2541. }
  2542. +
  2543.  
  2544. +
  2545. /**
  2546. +
  2547. * Encode a header string to best of Q, B, quoted or none.
  2548. +
  2549. * @access private
  2550. +
  2551. * @return string
  2552. +
  2553. */
  2554. +
  2555. function EncodeHeader ($str, $position = 'text') {
  2556. +
  2557. $x = 0;
  2558. +
  2559.  
  2560. +
  2561. switch (strtolower($position)) {
  2562. +
  2563. case 'phrase':
  2564. +
  2565. if (!preg_match('/[\200-\377]/', $str)) {
  2566. +
  2567. /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
  2568. +
  2569. $encoded = addcslashes($str, "\0..\37\177\\\"");
  2570. +
  2571. if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
  2572. +
  2573. return ($encoded);
  2574. +
  2575. } else {
  2576. +
  2577. return ("\"$encoded\"");
  2578. +
  2579. }
  2580. +
  2581. }
  2582. +
  2583. $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
  2584. +
  2585. break;
  2586. +
  2587. case 'comment':
  2588. +
  2589. $x = preg_match_all('/[()"]/', $str, $matches);
  2590. +
  2591. /* Fall-through */
  2592. +
  2593. case 'text':
  2594. +
  2595. default:
  2596. +
  2597. $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
  2598. +
  2599. break;
  2600. +
  2601. }
  2602. +
  2603.  
  2604. +
  2605. if ($x == 0) {
  2606. +
  2607. return ($str);
  2608. +
  2609. }
  2610. +
  2611.  
  2612. +
  2613. $maxlen = 75 - 7 - strlen($this->CharSet);
  2614. +
  2615. /* Try to select the encoding which should produce the shortest output */
  2616. +
  2617. if (strlen($str)/3 < $x) {
  2618. +
  2619. $encoding = 'B';
  2620. +
  2621. if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
  2622. +
  2623. // Use a custom function which correctly encodes and wraps long
  2624. +
  2625. // multibyte strings without breaking lines within a character
  2626. +
  2627. $encoded = $this->Base64EncodeWrapMB($str);
  2628. +
  2629. } else {
  2630. +
  2631. $encoded = base64_encode($str);
  2632. +
  2633. $maxlen -= $maxlen % 4;
  2634. +
  2635. $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
  2636. +
  2637. }
  2638. +
  2639. } else {
  2640. +
  2641. $encoding = 'Q';
  2642. +
  2643. $encoded = $this->EncodeQ($str, $position);
  2644. +
  2645. $encoded = $this->WrapText($encoded, $maxlen, true);
  2646. +
  2647. $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
  2648. +
  2649. }
  2650. +
  2651.  
  2652. +
  2653. $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
  2654. +
  2655. $encoded = trim(str_replace("\n", $this->LE, $encoded));
  2656. +
  2657.  
  2658. +
  2659. return $encoded;
  2660. +
  2661. }
  2662. +
  2663.  
  2664. +
  2665. /**
  2666. +
  2667. * Checks if a string contains multibyte characters.
  2668. +
  2669. * @access private
  2670. +
  2671. * @param string $str multi-byte text to wrap encode
  2672. +
  2673. * @return bool
  2674. +
  2675. */
  2676. +
  2677. function HasMultiBytes($str) {
  2678. +
  2679. if (function_exists('mb_strlen')) {
  2680. +
  2681. return (strlen($str) > mb_strlen($str, $this->CharSet));
  2682. +
  2683. } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
  2684. +
  2685. return False;
  2686. +
  2687. }
  2688. +
  2689. }
  2690. +
  2691.  
  2692. +
  2693. /**
  2694. +
  2695. * Correctly encodes and wraps long multibyte strings for mail headers
  2696. +
  2697. * without breaking lines within a character.
  2698. +
  2699. * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
  2700. +
  2701. * @access private
  2702. +
  2703. * @param string $str multi-byte text to wrap encode
  2704. +
  2705. * @return string
  2706. +
  2707. */
  2708. +
  2709. function Base64EncodeWrapMB($str) {
  2710. +
  2711. $start = "=?".$this->CharSet."?B?";
  2712. +
  2713. $end = "?=";
  2714. +
  2715. $encoded = "";
  2716. +
  2717.  
  2718. +
  2719. $mb_length = mb_strlen($str, $this->CharSet);
  2720. +
  2721. // Each line must have length <= 75, including $start and $end
  2722. +
  2723. $length = 75 - strlen($start) - strlen($end);
  2724. +
  2725. // Average multi-byte ratio
  2726. +
  2727. $ratio = $mb_length / strlen($str);
  2728. +
  2729. // Base64 has a 4:3 ratio
  2730. +
  2731. $offset = $avgLength = floor($length * $ratio * .75);
  2732. +
  2733.  
  2734. +
  2735. for ($i = 0; $i < $mb_length; $i += $offset) {
  2736. +
  2737. $lookBack = 0;
  2738. +
  2739.  
  2740. +
  2741. do {
  2742. +
  2743. $offset = $avgLength - $lookBack;
  2744. +
  2745. $chunk = mb_substr($str, $i, $offset, $this->CharSet);
  2746. +
  2747. $chunk = base64_encode($chunk);
  2748. +
  2749. $lookBack++;
  2750. +
  2751. }
  2752. +
  2753. while (strlen($chunk) > $length);
  2754. +
  2755.  
  2756. +
  2757. $encoded .= $chunk . $this->LE;
  2758. +
  2759. }
  2760. +
  2761.  
  2762. +
  2763. // Chomp the last linefeed
  2764. +
  2765. $encoded = substr($encoded, 0, -strlen($this->LE));
  2766. +
  2767. return $encoded;
  2768. +
  2769. }
  2770. +
  2771.  
  2772. +
  2773. /**
  2774. +
  2775. * Encode string to quoted-printable.
  2776. +
  2777. * @access private
  2778. +
  2779. * @return string
  2780. +
  2781. */
  2782. +
  2783. function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
  2784. +
  2785. $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
  2786. +
  2787. $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
  2788. +
  2789. $eol = "\r\n";
  2790. +
  2791. $escape = '=';
  2792. +
  2793. $output = '';
  2794. +
  2795. while( list(, $line) = each($lines) ) {
  2796. +
  2797. $linlen = strlen($line);
  2798. +
  2799. $newline = '';
  2800. +
  2801. for($i = 0; $i < $linlen; $i++) {
  2802. +
  2803. $c = substr( $line, $i, 1 );
  2804. +
  2805. $dec = ord( $c );
  2806. +
  2807. if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
  2808. +
  2809. $c = '=2E';
  2810. +
  2811. }
  2812. +
  2813. if ( $dec == 32 ) {
  2814. +
  2815. if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
  2816. +
  2817. $c = '=20';
  2818. +
  2819. } else if ( $space_conv ) {
  2820. +
  2821. $c = '=20';
  2822. +
  2823. }
  2824. +
  2825. } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
  2826. +
  2827. $h2 = floor($dec/16);
  2828. +
  2829. $h1 = floor($dec%16);
  2830. +
  2831. $c = $escape.$hex[$h2].$hex[$h1];
  2832. +
  2833. }
  2834. +
  2835. if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
  2836. +
  2837. $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
  2838. +
  2839. $newline = '';
  2840. +
  2841. // check if newline first character will be point or not
  2842. +
  2843. if ( $dec == 46 ) {
  2844. +
  2845. $c = '=2E';
  2846. +
  2847. }
  2848. +
  2849. }
  2850. +
  2851. $newline .= $c;
  2852. +
  2853. } // end of for
  2854. +
  2855. $output .= $newline.$eol;
  2856. +
  2857. } // end of while
  2858. +
  2859. return $output;
  2860. +
  2861. }
  2862. +
  2863.  
  2864. +
  2865. /**
  2866. +
  2867. * Encode string to q encoding.
  2868. +
  2869. * @access private
  2870. +
  2871. * @return string
  2872. +
  2873. */
  2874. +
  2875. function EncodeQ ($str, $position = 'text') {
  2876. +
  2877. /* There should not be any EOL in the string */
  2878. +
  2879. $encoded = preg_replace("[\r\n]", '', $str);
  2880. +
  2881.  
  2882. +
  2883. switch (strtolower($position)) {
  2884. +
  2885. case 'phrase':
  2886. +
  2887. $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
  2888. +
  2889. break;
  2890. +
  2891. case 'comment':
  2892. +
  2893. $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
  2894. +
  2895. case 'text':
  2896. +
  2897. default:
  2898. +
  2899. /* Replace every high ascii, control =, ? and _ characters */
  2900. +
  2901. $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
  2902. +
  2903. "'='.sprintf('%02X', ord('\\1'))", $encoded);
  2904. +
  2905. break;
  2906. +
  2907. }
  2908. +
  2909.  
  2910. +
  2911. /* Replace every spaces to _ (more readable than =20) */
  2912. +
  2913. $encoded = str_replace(' ', '_', $encoded);
  2914. +
  2915.  
  2916. +
  2917. return $encoded;
  2918. +
  2919. }
  2920. +
  2921.  
  2922. +
  2923. /**
  2924. +
  2925. * Adds a string or binary attachment (non-filesystem) to the list.
  2926. +
  2927. * This method can be used to attach ascii or binary data,
  2928. +
  2929. * such as a BLOB record from a database.
  2930. +
  2931. * @param string $string String attachment data.
  2932. +
  2933. * @param string $filename Name of the attachment.
  2934. +
  2935. * @param string $encoding File encoding (see $Encoding).
  2936. +
  2937. * @param string $type File extension (MIME) type.
  2938. +
  2939. * @return void
  2940. +
  2941. */
  2942. +
  2943. function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
  2944. +
  2945. /* Append to $attachment array */
  2946. +
  2947. $cur = count($this->attachment);
  2948. +
  2949. $this->attachment[$cur][0] = $string;
  2950. +
  2951. $this->attachment[$cur][1] = $filename;
  2952. +
  2953. $this->attachment[$cur][2] = $filename;
  2954. +
  2955. $this->attachment[$cur][3] = $encoding;
  2956. +
  2957. $this->attachment[$cur][4] = $type;
  2958. +
  2959. $this->attachment[$cur][5] = true; // isString
  2960. +
  2961. $this->attachment[$cur][6] = 'attachment';
  2962. +
  2963. $this->attachment[$cur][7] = 0;
  2964. +
  2965. }
  2966. +
  2967.  
  2968. +
  2969. /**
  2970. +
  2971. * Adds an embedded attachment. This can include images, sounds, and
  2972. +
  2973. * just about any other document. Make sure to set the $type to an
  2974. +
  2975. * image type. For JPEG images use "image/jpeg" and for GIF images
  2976. +
  2977. * use "image/gif".
  2978. +
  2979. * @param string $path Path to the attachment.
  2980. +
  2981. * @param string $cid Content ID of the attachment. Use this to identify
  2982. +
  2983. * the Id for accessing the image in an HTML form.
  2984. +
  2985. * @param string $name Overrides the attachment name.
  2986. +
  2987. * @param string $encoding File encoding (see $Encoding).
  2988. +
  2989. * @param string $type File extension (MIME) type.
  2990. +
  2991. * @return bool
  2992. +
  2993. */
  2994. +
  2995. function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
  2996. +
  2997.  
  2998. +
  2999. if(!@is_file($path)) {
  3000. +
  3001. $this->SetError($this->Lang('file_access') . $path);
  3002. +
  3003. return false;
  3004. +
  3005. }
  3006. +
  3007.  
  3008. +
  3009. $filename = basename($path);
  3010. +
  3011. if($name == '') {
  3012. +
  3013. $name = $filename;
  3014. +
  3015. }
  3016. +
  3017.  
  3018. +
  3019. /* Append to $attachment array */
  3020. +
  3021. $cur = count($this->attachment);
  3022. +
  3023. $this->attachment[$cur][0] = $path;
  3024. +
  3025. $this->attachment[$cur][1] = $filename;
  3026. +
  3027. $this->attachment[$cur][2] = $name;
  3028. +
  3029. $this->attachment[$cur][3] = $encoding;
  3030. +
  3031. $this->attachment[$cur][4] = $type;
  3032. +
  3033. $this->attachment[$cur][5] = false;
  3034. +
  3035. $this->attachment[$cur][6] = 'inline';
  3036. +
  3037. $this->attachment[$cur][7] = $cid;
  3038. +
  3039.  
  3040. +
  3041. return true;
  3042. +
  3043. }
  3044. +
  3045.  
  3046. +
  3047. /**
  3048. +
  3049. * Returns true if an inline attachment is present.
  3050. +
  3051. * @access private
  3052. +
  3053. * @return bool
  3054. +
  3055. */
  3056. +
  3057. function InlineImageExists() {
  3058. +
  3059. $result = false;
  3060. +
  3061. for($i = 0; $i < count($this->attachment); $i++) {
  3062. +
  3063. if($this->attachment[$i][6] == 'inline') {
  3064. +
  3065. $result = true;
  3066. +
  3067. break;
  3068. +
  3069. }
  3070. +
  3071. }
  3072. +
  3073.  
  3074. +
  3075. return $result;
  3076. +
  3077. }
  3078. +
  3079.  
  3080. +
  3081. /////////////////////////////////////////////////
  3082. +
  3083. // CLASS METHODS, MESSAGE RESET
  3084. +
  3085. /////////////////////////////////////////////////
  3086. +
  3087.  
  3088. +
  3089. +
  3090.  
  3091. +
  3092. /**
  3093. +
  3094. * Clears all recipients assigned in the TO array. Returns void.
  3095. +
  3096. * @return void
  3097. +
  3098. */
  3099. +
  3100. function ClearAddresses() {
  3101. +
  3102. $this->to = array();
  3103. +
  3104. }
  3105. +
  3106.  
  3107. +
  3108. /**
  3109. +
  3110. * Clears all recipients assigned in the CC array. Returns void.
  3111. +
  3112. * @return void
  3113. +
  3114. */
  3115. +
  3116. function ClearCCs() {
  3117. +
  3118. $this->cc = array();
  3119. +
  3120. }
  3121. +
  3122.  
  3123. +
  3124. /**
  3125. +
  3126. * Clears all recipients assigned in the BCC array. Returns void.
  3127. +
  3128. * @return void
  3129. +
  3130. */
  3131. +
  3132. function ClearBCCs() {
  3133. +
  3134. $this->bcc = array();
  3135. +
  3136. }
  3137. +
  3138.  
  3139. +
  3140. /**
  3141. +
  3142. * Clears all recipients assigned in the ReplyTo array. Returns void.
  3143. +
  3144. * @return void
  3145. +
  3146. */
  3147. +
  3148. function ClearReplyTos() {
  3149. +
  3150. $this->ReplyTo = array();
  3151. +
  3152. }
  3153. +
  3154.  
  3155. +
  3156. /**
  3157. +
  3158. * Clears all recipients assigned in the TO, CC and BCC
  3159. +
  3160. * array. Returns void.
  3161. +
  3162. * @return void
  3163. +
  3164. */
  3165. +
  3166. function ClearAllRecipients() {
  3167. +
  3168. $this->to = array();
  3169. +
  3170. $this->cc = array();
  3171. +
  3172. $this->bcc = array();
  3173. +
  3174. }
  3175. +
  3176.  
  3177. +
  3178. /**
  3179. +
  3180. * Clears all previously set filesystem, string, and binary
  3181. +
  3182. * attachments. Returns void.
  3183. +
  3184. * @return void
  3185. +
  3186. */
  3187. +
  3188. function ClearAttachments() {
  3189. +
  3190. $this->attachment = array();
  3191. +
  3192. }
  3193. +
  3194.  
  3195. +
  3196. /**
  3197. +
  3198. * Clears all custom headers. Returns void.
  3199. +
  3200. * @return void
  3201. +
  3202. */
  3203. +
  3204. function ClearCustomHeaders() {
  3205. +
  3206. $this->CustomHeader = array();
  3207. +
  3208. }
  3209. +
  3210.  
  3211. +
  3212. /////////////////////////////////////////////////
  3213. +
  3214. // CLASS METHODS, MISCELLANEOUS
  3215. +
  3216. /////////////////////////////////////////////////
  3217. +
  3218.  
  3219. +
  3220. +
  3221.  
  3222. +
  3223. /**
  3224. +
  3225. * Adds the error message to the error container.
  3226. +
  3227. * Returns void.
  3228. +
  3229. * @access private
  3230. +
  3231. * @return void
  3232. +
  3233. */
  3234. +
  3235. function SetError($msg) {
  3236. +
  3237. $this->error_count++;
  3238. +
  3239. $this->ErrorInfo = $msg;
  3240. +
  3241. }
  3242. +
  3243.  
  3244. +
  3245. /**
  3246. +
  3247. * Returns the proper RFC 822 formatted date.
  3248. +
  3249. * @access private
  3250. +
  3251. * @return string
  3252. +
  3253. */
  3254. +
  3255. function RFCDate() {
  3256. +
  3257. $tz = date('Z');
  3258. +
  3259. $tzs = ($tz < 0) ? '-' : '+';
  3260. +
  3261. $tz = abs($tz);
  3262. +
  3263. $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
  3264. +
  3265. $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
  3266. +
  3267.  
  3268. +
  3269. return $result;
  3270. +
  3271. }
  3272. +
  3273.  
  3274. +
  3275. /**
  3276. +
  3277. * Returns the appropriate server variable. Should work with both
  3278. +
  3279. * PHP 4.1.0+ as well as older versions. Returns an empty string
  3280. +
  3281. * if nothing is found.
  3282. +
  3283. * @access private
  3284. +
  3285. * @return mixed
  3286. +
  3287. */
  3288. +
  3289. function ServerVar($varName) {
  3290. +
  3291. global $HTTP_SERVER_VARS;
  3292. +
  3293. global $HTTP_ENV_VARS;
  3294. +
  3295.  
  3296. +
  3297. if(!isset($_SERVER)) {
  3298. +
  3299. $_SERVER = $HTTP_SERVER_VARS;
  3300. +
  3301. if(!isset($_SERVER['REMOTE_ADDR'])) {
  3302. +
  3303. $_SERVER = $HTTP_ENV_VARS; // must be Apache
  3304. +
  3305. }
  3306. +
  3307. }
  3308. +
  3309.  
  3310. +
  3311. if(isset($_SERVER[$varName])) {
  3312. +
  3313. return $_SERVER[$varName];
  3314. +
  3315. } else {
  3316. +
  3317. return '';
  3318. +
  3319. }
  3320. +
  3321. }
  3322. +
  3323.  
  3324. +
  3325. /**
  3326. +
  3327. * Returns the server hostname or 'localhost.localdomain' if unknown.
  3328. +
  3329. * @access private
  3330. +
  3331. * @return string
  3332. +
  3333. */
  3334. +
  3335. function ServerHostname() {
  3336. +
  3337. if ($this->Hostname != '') {
  3338. +
  3339. $result = $this->Hostname;
  3340. +
  3341. } elseif ($this->ServerVar('SERVER_NAME') != '') {
  3342. +
  3343. $result = $this->ServerVar('SERVER_NAME');
  3344. +
  3345. } else {
  3346. +
  3347. $result = 'localhost.localdomain';
  3348. +
  3349. }
  3350. +
  3351.  
  3352. +
  3353. return $result;
  3354. +
  3355. }
  3356. +
  3357.  
  3358. +
  3359. /**
  3360. +
  3361. * Returns a message in the appropriate language.
  3362. +
  3363. * @access private
  3364. +
  3365. * @return string
  3366. +
  3367. */
  3368. +
  3369. function Lang($key) {
  3370. +
  3371. if(count($this->language) < 1) {
  3372. +
  3373. $this->SetLanguage('en'); // set the default language
  3374. +
  3375. }
  3376. +
  3377.  
  3378. +
  3379. if(isset($this->language[$key])) {
  3380. +
  3381. return $this->language[$key];
  3382. +
  3383. } else {
  3384. +
  3385. return 'Language string failed to load: ' . $key;
  3386. +
  3387. }
  3388. +
  3389. }
  3390. +
  3391.  
  3392. +
  3393. /**
  3394. +
  3395. * Returns true if an error occurred.
  3396. +
  3397. * @return bool
  3398. +
  3399. */
  3400. +
  3401. function IsError() {
  3402. +
  3403. return ($this->error_count > 0);
  3404. +
  3405. }
  3406. +
  3407.  
  3408. +
  3409. /**
  3410. +
  3411. * Changes every end of line from CR or LF to CRLF.
  3412. +
  3413. * @access private
  3414. +
  3415. * @return string
  3416. +
  3417. */
  3418. +
  3419. function FixEOL($str) {
  3420. +
  3421. $str = str_replace("\r\n", "\n", $str);
  3422. +
  3423. $str = str_replace("\r", "\n", $str);
  3424. +
  3425. $str = str_replace("\n", $this->LE, $str);
  3426. +
  3427. return $str;
  3428. +
  3429. }
  3430. +
  3431.  
  3432. +
  3433. /**
  3434. +
  3435. * Adds a custom header.
  3436. +
  3437. * @return void
  3438. +
  3439. */
  3440. +
  3441. function AddCustomHeader($custom_header) {
  3442. +
  3443. $this->CustomHeader[] = explode(':', $custom_header, 2);
  3444. +
  3445. }
  3446. +
  3447.  
  3448. +
  3449. /**
  3450. +
  3451. * Evaluates the message and returns modifications for inline images and backgrounds
  3452. +
  3453. * @access public
  3454. +
  3455. * @return $message
  3456. +
  3457. */
  3458. +
  3459. function MsgHTML($message,$basedir='') {
  3460. +
  3461. preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
  3462. +
  3463. if(isset($images[2])) {
  3464. +
  3465. foreach($images[2] as $i => $url) {
  3466. +
  3467. // do not change urls for absolute images (thanks to corvuscorax)
  3468. +
  3469. if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
  3470. +
  3471. $filename = basename($url);
  3472. +
  3473. $directory = dirname($url);
  3474. +
  3475. ($directory == '.')?$directory='':'';
  3476. +
  3477. $cid = 'cid:' . md5($filename);
  3478. +
  3479. $fileParts = split("\.", $filename);
  3480. +
  3481. $ext = $fileParts[1];
  3482. +
  3483. $mimeType = $this->_mime_types($ext);
  3484. +
  3485. if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
  3486. +
  3487. if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
  3488. +
  3489. if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
  3490. +
  3491. $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
  3492. +
  3493. }
  3494. +
  3495. }
  3496. +
  3497. }
  3498. +
  3499. }
  3500. +
  3501. $this->IsHTML(true);
  3502. +
  3503. $this->Body = $message;
  3504. +
  3505. $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
  3506. +
  3507. if ( !empty($textMsg) && empty($this->AltBody) ) {
  3508. +
  3509. $this->AltBody = html_entity_decode($textMsg);
  3510. +
  3511. }
  3512. +
  3513. if ( empty($this->AltBody) ) {
  3514. +
  3515. $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
  3516. +
  3517. }
  3518. +
  3519. }
  3520. +
  3521.  
  3522. +
  3523. /**
  3524. +
  3525. * Gets the mime type of the embedded or inline image
  3526. +
  3527. * @access private
  3528. +
  3529. * @return mime type of ext
  3530. +
  3531. */
  3532. +
  3533. function _mime_types($ext = '') {
  3534. +
  3535. $mimes = array(
  3536. +
  3537. 'ai' => 'application/postscript',
  3538. +
  3539. 'aif' => 'audio/x-aiff',
  3540. +
  3541. 'aifc' => 'audio/x-aiff',
  3542. +
  3543. 'aiff' => 'audio/x-aiff',
  3544. +
  3545. 'avi' => 'video/x-msvideo',
  3546. +
  3547. 'bin' => 'application/macbinary',
  3548. +
  3549. 'bmp' => 'image/bmp',
  3550. +
  3551. 'class' => 'application/octet-stream',
  3552. +
  3553. 'cpt' => 'application/mac-compactpro',
  3554. +
  3555. 'css' => 'text/css',
  3556. +
  3557. 'dcr' => 'application/x-director',
  3558. +
  3559. 'dir' => 'application/x-director',
  3560. +
  3561. 'dll' => 'application/octet-stream',
  3562. +
  3563. 'dms' => 'application/octet-stream',
  3564. +
  3565. 'doc' => 'application/msword',
  3566. +
  3567. 'dvi' => 'application/x-dvi',
  3568. +
  3569. 'dxr' => 'application/x-director',
  3570. +
  3571. 'eml' => 'message/rfc822',
  3572. +
  3573. 'eps' => 'application/postscript',
  3574. +
  3575. 'exe' => 'application/octet-stream',
  3576. +
  3577. 'gif' => 'image/gif',
  3578. +
  3579. 'gtar' => 'application/x-gtar',
  3580. +
  3581. 'htm' => 'text/html',
  3582. +
  3583. 'html' => 'text/html',
  3584. +
  3585. 'jpe' => 'image/jpeg',
  3586. +
  3587. 'jpeg' => 'image/jpeg',
  3588. +
  3589. 'jpg' => 'image/jpeg',
  3590. +
  3591. 'hqx' => 'application/mac-binhex40',
  3592. +
  3593. 'js' => 'application/x-javascript',
  3594. +
  3595. 'lha' => 'application/octet-stream',
  3596. +
  3597. 'log' => 'text/plain',
  3598. +
  3599. 'lzh' => 'application/octet-stream',
  3600. +
  3601. 'mid' => 'audio/midi',
  3602. +
  3603. 'midi' => 'audio/midi',
  3604. +
  3605. 'mif' => 'application/vnd.mif',
  3606. +
  3607. 'mov' => 'video/quicktime',
  3608. +
  3609. 'movie' => 'video/x-sgi-movie',
  3610. +
  3611. 'mp2' => 'audio/mpeg',
  3612. +
  3613. 'mp3' => 'audio/mpeg',
  3614. +
  3615. 'mpe' => 'video/mpeg',
  3616. +
  3617. 'mpeg' => 'video/mpeg',
  3618. +
  3619. 'mpg' => 'video/mpeg',
  3620. +
  3621. 'mpga' => 'audio/mpeg',
  3622. +
  3623. 'oda' => 'application/oda',
  3624. +
  3625. 'pdf' => 'application/pdf',
  3626. +
  3627. 'php' => 'application/x-httpd-php',
  3628. +
  3629. 'php3' => 'application/x-httpd-php',
  3630. +
  3631. 'php4' => 'application/x-httpd-php',
  3632. +
  3633. 'phps' => 'application/x-httpd-php-source',
  3634. +
  3635. 'phtml' => 'application/x-httpd-php',
  3636. +
  3637. 'png' => 'image/png',
  3638. +
  3639. 'ppt' => 'application/vnd.ms-powerpoint',
  3640. +
  3641. 'ps' => 'application/postscript',
  3642. +
  3643. 'psd' => 'application/octet-stream',
  3644. +
  3645. 'qt' => 'video/quicktime',
  3646. +
  3647. 'ra' => 'audio/x-realaudio',
  3648. +
  3649. 'ram' => 'audio/x-pn-realaudio',
  3650. +
  3651. 'rm' => 'audio/x-pn-realaudio',
  3652. +
  3653. 'rpm' => 'audio/x-pn-realaudio-plugin',
  3654. +
  3655. 'rtf' => 'text/rtf',
  3656. +
  3657. 'rtx' => 'text/richtext',
  3658. +
  3659. 'rv' => 'video/vnd.rn-realvideo',
  3660. +
  3661. 'sea' => 'application/octet-stream',
  3662. +
  3663. 'shtml' => 'text/html',
  3664. +
  3665. 'sit' => 'application/x-stuffit',
  3666. +
  3667. 'so' => 'application/octet-stream',
  3668. +
  3669. 'smi' => 'application/smil',
  3670. +
  3671. 'smil' => 'application/smil',
  3672. +
  3673. 'swf' => 'application/x-shockwave-flash',
  3674. +
  3675. 'tar' => 'application/x-tar',
  3676. +
  3677. 'text' => 'text/plain',
  3678. +
  3679. 'txt' => 'text/plain',
  3680. +
  3681. 'tgz' => 'application/x-tar',
  3682. +
  3683. 'tif' => 'image/tiff',
  3684. +
  3685. 'tiff' => 'image/tiff',
  3686. +
  3687. 'wav' => 'audio/x-wav',
  3688. +
  3689. 'wbxml' => 'application/vnd.wap.wbxml',
  3690. +
  3691. 'wmlc' => 'application/vnd.wap.wmlc',
  3692. +
  3693. 'word' => 'application/msword',
  3694. +
  3695. 'xht' => 'application/xhtml+xml',
  3696. +
  3697. 'xhtml' => 'application/xhtml+xml',
  3698. +
  3699. 'xl' => 'application/excel',
  3700. +
  3701. 'xls' => 'application/vnd.ms-excel',
  3702. +
  3703. 'xml' => 'text/xml',
  3704. +
  3705. 'xsl' => 'text/xml',
  3706. +
  3707. 'zip' => 'application/zip'
  3708. +
  3709. );
  3710. +
  3711. return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
  3712. +
  3713. }
  3714. +
  3715.  
  3716. +
  3717. /**
  3718. +
  3719. * Set (or reset) Class Objects (variables)
  3720. +
  3721. *
  3722. +
  3723. * Usage Example:
  3724. +
  3725. * $page->set('X-Priority', '3');
  3726. +
  3727. *
  3728. +
  3729. * @access public
  3730. +
  3731. * @param string $name Parameter Name
  3732. +
  3733. * @param mixed $value Parameter Value
  3734. +
  3735. * NOTE: will not work with arrays, there are no arrays to set/reset
  3736. +
  3737. */
  3738. +
  3739. function set ( $name, $value = '' ) {
  3740. +
  3741. if ( isset($this->$name) ) {
  3742. +
  3743. $this->$name = $value;
  3744. +
  3745. } else {
  3746. +
  3747. $this->SetError('Cannot set or reset variable ' . $name);
  3748. +
  3749. return false;
  3750. +
  3751. }
  3752. +
  3753. }
  3754. +
  3755.  
  3756. +
  3757. /**
  3758. +
  3759. * Read a file from a supplied filename and return it.
  3760. +
  3761. *
  3762. +
  3763. * @access public
  3764. +
  3765. * @param string $filename Parameter File Name
  3766. +
  3767. */
  3768. +
  3769. function getFile($filename) {
  3770. +
  3771. $return = '';
  3772. +
  3773. if ($fp = fopen($filename, 'rb')) {
  3774. +
  3775. while (!feof($fp)) {
  3776. +
  3777. $return .= fread($fp, 1024);
  3778. +
  3779. }
  3780. +
  3781. fclose($fp);
  3782. +
  3783. return $return;
  3784. +
  3785. } else {
  3786. +
  3787. return false;
  3788. +
  3789. }
  3790. +
  3791. }
  3792. +
  3793.  
  3794. +
  3795. /**
  3796. +
  3797. * Strips newlines to prevent header injection.
  3798. +
  3799. * @access private
  3800. +
  3801. * @param string $str String
  3802. +
  3803. * @return string
  3804. +
  3805. */
  3806. +
  3807. function SecureHeader($str) {
  3808. +
  3809. $str = trim($str);
  3810. +
  3811. $str = str_replace("\r", "", $str);
  3812. +
  3813. $str = str_replace("\n", "", $str);
  3814. +
  3815. return $str;
  3816. +
  3817. }
  3818. +
  3819.  
  3820. +
  3821. /**
  3822. +
  3823. * Set the private key file and password to sign the message.
  3824. +
  3825. *
  3826. +
  3827. * @access public
  3828. +
  3829. * @param string $key_filename Parameter File Name
  3830. +
  3831. * @param string $key_pass Password for private key
  3832. +
  3833. */
  3834. +
  3835. function Sign($cert_filename, $key_filename, $key_pass) {
  3836. +
  3837. $this->sign_cert_file = $cert_filename;
  3838. +
  3839. $this->sign_key_file = $key_filename;
  3840. +
  3841. $this->sign_key_pass = $key_pass;
  3842. +
  3843. }
  3844. +
  3845.  
  3846. +
  3847. }
  3848. +
  3849.  
  3850. +
  3851. ?>
  3852. +
+
+

+ Documentation generated on Thu, 02 Apr 2009 21:19:47 -0400 by phpDocumentor 1.3.0RC3 +

+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.pop3.php.html b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.pop3.php.html new file mode 100644 index 000000000..3fbc19de2 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.pop3.php.html @@ -0,0 +1,460 @@ + + + + + + File Source for class.pop3.php + + + + +

Source for file class.pop3.php

+

Documentation is available at class.pop3.php

+
+
  1. <?php
  2. +
  3. /*~ class.pop3.php
  4. +
  5. .---------------------------------------------------------------------------.
  6. +
  7. | Software: PHPMailer - PHP email class |
  8. +
  9. | Version: 2.0.4 |
  10. +
  11. | Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
  12. +
  13. | Info: http://phpmailer.sourceforge.net |
  14. +
  15. | Support: http://sourceforge.net/projects/phpmailer/ |
  16. +
  17. | ------------------------------------------------------------------------- |
  18. +
  19. | Author: Andy Prevost (project admininistrator) |
  20. +
  21. | Author: Brent R. Matzelle (original founder) |
  22. +
  23. | Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
  24. +
  25. | Copyright (c) 2001-2003, Brent R. Matzelle |
  26. +
  27. | ------------------------------------------------------------------------- |
  28. +
  29. | License: Distributed under the Lesser General Public License (LGPL) |
  30. +
  31. | http://www.gnu.org/copyleft/lesser.html |
  32. +
  33. | This program is distributed in the hope that it will be useful - WITHOUT |
  34. +
  35. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
  36. +
  37. | FITNESS FOR A PARTICULAR PURPOSE. |
  38. +
  39. | ------------------------------------------------------------------------- |
  40. +
  41. | We offer a number of paid services (www.codeworxtech.com): |
  42. +
  43. | - Web Hosting on highly optimized fast and secure servers |
  44. +
  45. | - Technology Consulting |
  46. +
  47. | - Oursourcing (highly qualified programmers and graphic designers) |
  48. +
  49. '---------------------------------------------------------------------------'
  50. +
  51.  
  52. +
  53.  
  54. +
  55.  
  56. +
  57. /**
  58. +
  59. * POP Before SMTP Authentication Class
  60. +
  61. *
  62. +
  63. * Author: Richard Davey (rich@corephp.co.uk)
  64. +
  65. * License: LGPL, see PHPMailer License
  66. +
  67. *
  68. +
  69. * Specifically for PHPMailer to allow POP before SMTP authentication.
  70. +
  71. * Does not yet work with APOP - if you have an APOP account, contact me
  72. +
  73. * and we can test changes to this script.
  74. +
  75. *
  76. +
  77. * This class is based on the structure of the SMTP class by Chris Ryan
  78. +
  79. *
  80. +
  81. * This class is rfc 1939 compliant and implements all the commands
  82. +
  83. * required for POP3 connection, authentication and disconnection.
  84. +
  85. *
  86. +
  87. * @package PHPMailer
  88. +
  89. * @author Richard Davey
  90. +
  91. */
  92. +
  93.  
  94. +
  95. class POP3
  96. +
  97. {
  98. +
  99. /**
  100. +
  101. * Default POP3 port
  102. +
  103. * @var int
  104. +
  105. */
  106. +
  107. var $POP3_PORT = 110;
  108. +
  109.  
  110. +
  111. /**
  112. +
  113. * Default Timeout
  114. +
  115. * @var int
  116. +
  117. */
  118. +
  119. var $POP3_TIMEOUT = 30;
  120. +
  121.  
  122. +
  123. /**
  124. +
  125. * POP3 Carriage Return + Line Feed
  126. +
  127. * @var string
  128. +
  129. */
  130. +
  131. var $CRLF = "\r\n";
  132. +
  133.  
  134. +
  135. /**
  136. +
  137. * Displaying Debug warnings? (0 = now, 1+ = yes)
  138. +
  139. * @var int
  140. +
  141. */
  142. +
  143. var $do_debug = 2;
  144. +
  145.  
  146. +
  147. /**
  148. +
  149. * POP3 Mail Server
  150. +
  151. * @var string
  152. +
  153. */
  154. +
  155. var $host;
  156. +
  157.  
  158. +
  159. /**
  160. +
  161. * POP3 Port
  162. +
  163. * @var int
  164. +
  165. */
  166. +
  167. var $port;
  168. +
  169.  
  170. +
  171. /**
  172. +
  173. * POP3 Timeout Value
  174. +
  175. * @var int
  176. +
  177. */
  178. +
  179. var $tval;
  180. +
  181.  
  182. +
  183. /**
  184. +
  185. * POP3 Username
  186. +
  187. * @var string
  188. +
  189. */
  190. +
  191. var $username;
  192. +
  193.  
  194. +
  195. /**
  196. +
  197. * POP3 Password
  198. +
  199. * @var string
  200. +
  201. */
  202. +
  203. var $password;
  204. +
  205.  
  206. +
  207. /**#@+
  208. +
  209. * @access private
  210. +
  211. */
  212. +
  213. var $pop_conn;
  214. +
  215. var $connected;
  216. +
  217. var $error; // Error log array
  218. +
  219. +
  220. /**#@-*/
  221. +
  222.  
  223. +
  224. /**
  225. +
  226. * Constructor, sets the initial values
  227. +
  228. *
  229. +
  230. * @return POP3
  231. +
  232. */
  233. +
  234. function POP3 ()
  235. +
  236. {
  237. +
  238. $this->pop_conn = 0;
  239. +
  240. $this->connected = false;
  241. +
  242. $this->error = null;
  243. +
  244. }
  245. +
  246.  
  247. +
  248. /**
  249. +
  250. * Combination of public events - connect, login, disconnect
  251. +
  252. *
  253. +
  254. * @param string $host
  255. +
  256. * @param integer $port
  257. +
  258. * @param integer $tval
  259. +
  260. * @param string $username
  261. +
  262. * @param string $password
  263. +
  264. */
  265. +
  266. function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0)
  267. +
  268. {
  269. +
  270. $this->host = $host;
  271. +
  272.  
  273. +
  274. // If no port value is passed, retrieve it
  275. +
  276. if ($port == false)
  277. +
  278. {
  279. +
  280. $this->port = $this->POP3_PORT;
  281. +
  282. }
  283. +
  284. else
  285. +
  286. {
  287. +
  288. $this->port = $port;
  289. +
  290. }
  291. +
  292.  
  293. +
  294. // If no port value is passed, retrieve it
  295. +
  296. if ($tval == false)
  297. +
  298. {
  299. +
  300. $this->tval = $this->POP3_TIMEOUT;
  301. +
  302. }
  303. +
  304. else
  305. +
  306. {
  307. +
  308. $this->tval = $tval;
  309. +
  310. }
  311. +
  312.  
  313. +
  314. $this->do_debug = $debug_level;
  315. +
  316. $this->username = $username;
  317. +
  318. $this->password = $password;
  319. +
  320.  
  321. +
  322. // Refresh the error log
  323. +
  324. $this->error = null;
  325. +
  326.  
  327. +
  328. // Connect
  329. +
  330. $result = $this->Connect($this->host, $this->port, $this->tval);
  331. +
  332.  
  333. +
  334. if ($result)
  335. +
  336. {
  337. +
  338. $login_result = $this->Login($this->username, $this->password);
  339. +
  340.  
  341. +
  342. if ($login_result)
  343. +
  344. {
  345. +
  346. $this->Disconnect();
  347. +
  348.  
  349. +
  350. return true;
  351. +
  352. }
  353. +
  354.  
  355. +
  356. }
  357. +
  358.  
  359. +
  360. // We need to disconnect regardless if the login succeeded
  361. +
  362. $this->Disconnect();
  363. +
  364.  
  365. +
  366. return false;
  367. +
  368. }
  369. +
  370.  
  371. +
  372. /**
  373. +
  374. * Connect to the POP3 server
  375. +
  376. *
  377. +
  378. * @param string $host
  379. +
  380. * @param integer $port
  381. +
  382. * @param integer $tval
  383. +
  384. * @return boolean
  385. +
  386. */
  387. +
  388. function Connect ($host, $port = false, $tval = 30)
  389. +
  390. {
  391. +
  392. // Are we already connected?
  393. +
  394. if ($this->connected)
  395. +
  396. {
  397. +
  398. return true;
  399. +
  400. }
  401. +
  402.  
  403. +
  404. /*
  405. +
  406. On Windows this will raise a PHP Warning error if the hostname doesn't exist.
  407. +
  408. Rather than supress it with @fsockopen, let's capture it cleanly instead
  409. +
  410. */
  411. +
  412.  
  413. +
  414. set_error_handler(array(&$this, 'catchWarning'));
  415. +
  416.  
  417. +
  418. // Connect to the POP3 server
  419. +
  420. $this->pop_conn = fsockopen($host, // POP3 Host
  421. +
  422. $port, // Port #
  423. +
  424. $errno, // Error Number
  425. +
  426. $errstr, // Error Message
  427. +
  428. $tval); // Timeout (seconds)
  429. +
  430.  
  431. +
  432. // Restore the error handler
  433. +
  434. restore_error_handler();
  435. +
  436.  
  437. +
  438. // Does the Error Log now contain anything?
  439. +
  440. if ($this->error && $this->do_debug >= 1)
  441. +
  442. {
  443. +
  444. $this->displayErrors();
  445. +
  446. }
  447. +
  448.  
  449. +
  450. // Did we connect?
  451. +
  452. if ($this->pop_conn == false)
  453. +
  454. {
  455. +
  456. // It would appear not...
  457. +
  458. $this->error = array(
  459. +
  460. 'error' => "Failed to connect to server $host on port $port",
  461. +
  462. 'errno' => $errno,
  463. +
  464. 'errstr' => $errstr
  465. +
  466. );
  467. +
  468.  
  469. +
  470. if ($this->do_debug >= 1)
  471. +
  472. {
  473. +
  474. $this->displayErrors();
  475. +
  476. }
  477. +
  478.  
  479. +
  480. return false;
  481. +
  482. }
  483. +
  484.  
  485. +
  486. // Increase the stream time-out
  487. +
  488.  
  489. +
  490. // Check for PHP 4.3.0 or later
  491. +
  492. if (version_compare(phpversion(), '4.3.0', 'ge'))
  493. +
  494. {
  495. +
  496. stream_set_timeout($this->pop_conn, $tval, 0);
  497. +
  498. }
  499. +
  500. else
  501. +
  502. {
  503. +
  504. // Does not work on Windows
  505. +
  506. if (substr(PHP_OS, 0, 3) !== 'WIN')
  507. +
  508. {
  509. +
  510. socket_set_timeout($this->pop_conn, $tval, 0);
  511. +
  512. }
  513. +
  514. }
  515. +
  516.  
  517. +
  518. // Get the POP3 server response
  519. +
  520. $pop3_response = $this->getResponse();
  521. +
  522.  
  523. +
  524. // Check for the +OK
  525. +
  526. if ($this->checkResponse($pop3_response))
  527. +
  528. {
  529. +
  530. // The connection is established and the POP3 server is talking
  531. +
  532. $this->connected = true;
  533. +
  534. return true;
  535. +
  536. }
  537. +
  538.  
  539. +
  540. }
  541. +
  542.  
  543. +
  544. /**
  545. +
  546. * Login to the POP3 server (does not support APOP yet)
  547. +
  548. *
  549. +
  550. * @param string $username
  551. +
  552. * @param string $password
  553. +
  554. * @return boolean
  555. +
  556. */
  557. +
  558. function Login ($username = '', $password = '')
  559. +
  560. {
  561. +
  562. if ($this->connected == false)
  563. +
  564. {
  565. +
  566. $this->error = 'Not connected to POP3 server';
  567. +
  568.  
  569. +
  570. if ($this->do_debug >= 1)
  571. +
  572. {
  573. +
  574. $this->displayErrors();
  575. +
  576. }
  577. +
  578. }
  579. +
  580.  
  581. +
  582. if (empty($username))
  583. +
  584. {
  585. +
  586. $username = $this->username;
  587. +
  588. }
  589. +
  590.  
  591. +
  592. if (empty($password))
  593. +
  594. {
  595. +
  596. $password = $this->password;
  597. +
  598. }
  599. +
  600.  
  601. +
  602. $pop_username = "USER $username" . $this->CRLF;
  603. +
  604. $pop_password = "PASS $password" . $this->CRLF;
  605. +
  606.  
  607. +
  608. // Send the Username
  609. +
  610. $this->sendString($pop_username);
  611. +
  612. $pop3_response = $this->getResponse();
  613. +
  614.  
  615. +
  616. if ($this->checkResponse($pop3_response))
  617. +
  618. {
  619. +
  620. // Send the Password
  621. +
  622. $this->sendString($pop_password);
  623. +
  624. $pop3_response = $this->getResponse();
  625. +
  626.  
  627. +
  628. if ($this->checkResponse($pop3_response))
  629. +
  630. {
  631. +
  632. return true;
  633. +
  634. }
  635. +
  636. else
  637. +
  638. {
  639. +
  640. return false;
  641. +
  642. }
  643. +
  644. }
  645. +
  646. else
  647. +
  648. {
  649. +
  650. return false;
  651. +
  652. }
  653. +
  654. }
  655. +
  656.  
  657. +
  658. /**
  659. +
  660. * Disconnect from the POP3 server
  661. +
  662. */
  663. +
  664. function Disconnect ()
  665. +
  666. {
  667. +
  668. $this->sendString('QUIT');
  669. +
  670.  
  671. +
  672. fclose($this->pop_conn);
  673. +
  674. }
  675. +
  676.  
  677. +
  678. /*
  679. +
  680. ---------------
  681. +
  682. Private Methods
  683. +
  684. ---------------
  685. +
  686. */
  687. +
  688.  
  689. +
  690. /**
  691. +
  692. * Get the socket response back.
  693. +
  694. * $size is the maximum number of bytes to retrieve
  695. +
  696. *
  697. +
  698. * @param integer $size
  699. +
  700. * @return string
  701. +
  702. */
  703. +
  704. function getResponse ($size = 128)
  705. +
  706. {
  707. +
  708. $pop3_response = fgets($this->pop_conn, $size);
  709. +
  710.  
  711. +
  712. return $pop3_response;
  713. +
  714. }
  715. +
  716.  
  717. +
  718. /**
  719. +
  720. * Send a string down the open socket connection to the POP3 server
  721. +
  722. *
  723. +
  724. * @param string $string
  725. +
  726. * @return integer
  727. +
  728. */
  729. +
  730. function sendString ($string)
  731. +
  732. {
  733. +
  734. $bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
  735. +
  736.  
  737. +
  738. return $bytes_sent;
  739. +
  740.  
  741. +
  742. }
  743. +
  744.  
  745. +
  746. /**
  747. +
  748. * Checks the POP3 server response for +OK or -ERR
  749. +
  750. *
  751. +
  752. * @param string $string
  753. +
  754. * @return boolean
  755. +
  756. */
  757. +
  758. function checkResponse ($string)
  759. +
  760. {
  761. +
  762. if (substr($string, 0, 3) !== '+OK')
  763. +
  764. {
  765. +
  766. $this->error = array(
  767. +
  768. 'error' => "Server reported an error: $string",
  769. +
  770. 'errno' => 0,
  771. +
  772. 'errstr' => ''
  773. +
  774. );
  775. +
  776.  
  777. +
  778. if ($this->do_debug >= 1)
  779. +
  780. {
  781. +
  782. $this->displayErrors();
  783. +
  784. }
  785. +
  786.  
  787. +
  788. return false;
  789. +
  790. }
  791. +
  792. else
  793. +
  794. {
  795. +
  796. return true;
  797. +
  798. }
  799. +
  800.  
  801. +
  802. }
  803. +
  804.  
  805. +
  806. /**
  807. +
  808. * If debug is enabled, display the error message array
  809. +
  810. *
  811. +
  812. */
  813. +
  814. function displayErrors ()
  815. +
  816. {
  817. +
  818. echo '<pre>';
  819. +
  820.  
  821. +
  822. foreach ($this->error as $single_error)
  823. +
  824. {
  825. +
  826. print_r($single_error);
  827. +
  828. }
  829. +
  830.  
  831. +
  832. echo '</pre>';
  833. +
  834. }
  835. +
  836.  
  837. +
  838. /**
  839. +
  840. * Takes over from PHP for the socket warning handler
  841. +
  842. *
  843. +
  844. * @param integer $errno
  845. +
  846. * @param string $errstr
  847. +
  848. * @param string $errfile
  849. +
  850. * @param integer $errline
  851. +
  852. */
  853. +
  854. function catchWarning ($errno, $errstr, $errfile, $errline)
  855. +
  856. {
  857. +
  858. $this->error[] = array(
  859. +
  860. 'error' => "Connecting to the POP3 server raised a PHP warning: ",
  861. +
  862. 'errno' => $errno,
  863. +
  864. 'errstr' => $errstr
  865. +
  866. );
  867. +
  868. }
  869. +
  870.  
  871. +
  872. // End of class
  873. +
  874.  
  875. +
  876. }
  877. +
  878. ?>
  879. +
+
+

+ Documentation generated on Thu, 02 Apr 2009 21:19:49 -0400 by phpDocumentor 1.3.0RC3 +

+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.smtp.php.html b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.smtp.php.html new file mode 100644 index 000000000..5dd8e6f8d --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/__filesource/fsource_PHPMailer__class.smtp.php.html @@ -0,0 +1,1092 @@ + + + + + + File Source for class.smtp.php + + + + +

Source for file class.smtp.php

+

Documentation is available at class.smtp.php

+
+
  1. <?php
  2. +
  3. /*~ class.smtp.php
  4. +
  5. .---------------------------------------------------------------------------.
  6. +
  7. | Software: PHPMailer - PHP email class |
  8. +
  9. | Version: 2.0.4 |
  10. +
  11. | Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
  12. +
  13. | Info: http://phpmailer.sourceforge.net |
  14. +
  15. | Support: http://sourceforge.net/projects/phpmailer/ |
  16. +
  17. | ------------------------------------------------------------------------- |
  18. +
  19. | Author: Andy Prevost (project admininistrator) |
  20. +
  21. | Author: Brent R. Matzelle (original founder) |
  22. +
  23. | Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
  24. +
  25. | Copyright (c) 2001-2003, Brent R. Matzelle |
  26. +
  27. | ------------------------------------------------------------------------- |
  28. +
  29. | License: Distributed under the Lesser General Public License (LGPL) |
  30. +
  31. | http://www.gnu.org/copyleft/lesser.html |
  32. +
  33. | This program is distributed in the hope that it will be useful - WITHOUT |
  34. +
  35. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
  36. +
  37. | FITNESS FOR A PARTICULAR PURPOSE. |
  38. +
  39. | ------------------------------------------------------------------------- |
  40. +
  41. | We offer a number of paid services (www.codeworxtech.com): |
  42. +
  43. | - Web Hosting on highly optimized fast and secure servers |
  44. +
  45. | - Technology Consulting |
  46. +
  47. | - Oursourcing (highly qualified programmers and graphic designers) |
  48. +
  49. '---------------------------------------------------------------------------'
  50. +
  51.  
  52. +
  53.  
  54. +
  55.  
  56. +
  57. /**
  58. +
  59. * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
  60. +
  61. * commands except TURN which will always return a not implemented
  62. +
  63. * error. SMTP also provides some utility methods for sending mail
  64. +
  65. * to an SMTP server.
  66. +
  67. * @package PHPMailer
  68. +
  69. * @author Chris Ryan
  70. +
  71. */
  72. +
  73.  
  74. +
  75. class SMTP
  76. +
  77. {
  78. +
  79. /**
  80. +
  81. * SMTP server port
  82. +
  83. * @var int
  84. +
  85. */
  86. +
  87. var $SMTP_PORT = 25;
  88. +
  89.  
  90. +
  91. /**
  92. +
  93. * SMTP reply line ending
  94. +
  95. * @var string
  96. +
  97. */
  98. +
  99. var $CRLF = "\r\n";
  100. +
  101.  
  102. +
  103. /**
  104. +
  105. * Sets whether debugging is turned on
  106. +
  107. * @var bool
  108. +
  109. */
  110. +
  111. var $do_debug; # the level of debug to perform
  112. +
  113.  
  114. +
  115. +
  116.  
  117. +
  118. /**
  119. +
  120. * Sets VERP use on/off (default is off)
  121. +
  122. * @var bool
  123. +
  124. */
  125. +
  126. var $do_verp = false;
  127. +
  128.  
  129. +
  130. /**#@+
  131. +
  132. * @access private
  133. +
  134. */
  135. +
  136. var $smtp_conn; # the socket to the server
  137. +
  138. +
  139. var $error; # error if any on the last call
  140. +
  141. +
  142. var $helo_rply; # the reply the server sent to us for HELO
  143. +
  144. +
  145. /**#@-*/
  146. +
  147.  
  148. +
  149. /**
  150. +
  151. * Initialize the class so that the data is in a known state.
  152. +
  153. * @access public
  154. +
  155. * @return void
  156. +
  157. */
  158. +
  159. function SMTP() {
  160. +
  161. $this->smtp_conn = 0;
  162. +
  163. $this->error = null;
  164. +
  165. $this->helo_rply = null;
  166. +
  167.  
  168. +
  169. $this->do_debug = 0;
  170. +
  171. }
  172. +
  173.  
  174. +
  175. /***********************************************************
  176. +
  177. * CONNECTION FUNCTIONS *
  178. +
  179. ***********************************************************/
  180. +
  181.  
  182. +
  183.  
  184. +
  185. /**
  186. +
  187. * Connect to the server specified on the port specified.
  188. +
  189. * If the port is not specified use the default SMTP_PORT.
  190. +
  191. * If tval is specified then a connection will try and be
  192. +
  193. * established with the server for that number of seconds.
  194. +
  195. * If tval is not specified the default is 30 seconds to
  196. +
  197. * try on the connection.
  198. +
  199. *
  200. +
  201. * SMTP CODE SUCCESS: 220
  202. +
  203. * SMTP CODE FAILURE: 421
  204. +
  205. * @access public
  206. +
  207. * @return bool
  208. +
  209. */
  210. +
  211. function Connect($host,$port=0,$tval=30) {
  212. +
  213. # set the error val to null so there is no confusion
  214. +
  215. $this->error = null;
  216. +
  217.  
  218. +
  219. # make sure we are __not__ connected
  220. +
  221. if($this->connected()) {
  222. +
  223. # ok we are connected! what should we do?
  224. +
  225. # for now we will just give an error saying we
  226. +
  227. # are already connected
  228. +
  229. $this->error = array("error" => "Already connected to a server");
  230. +
  231. return false;
  232. +
  233. }
  234. +
  235.  
  236. +
  237. if(empty($port)) {
  238. +
  239. $port = $this->SMTP_PORT;
  240. +
  241. }
  242. +
  243.  
  244. +
  245. #connect to the smtp server
  246. +
  247. $this->smtp_conn = fsockopen($host, # the host of the server
  248. +
  249. $port, # the port to use
  250. +
  251. $errno, # error number if any
  252. +
  253. $errstr, # error message if any
  254. +
  255. $tval); # give up after ? secs
  256. +
  257. # verify we connected properly
  258. +
  259. if(empty($this->smtp_conn)) {
  260. +
  261. $this->error = array("error" => "Failed to connect to server",
  262. +
  263. "errno" => $errno,
  264. +
  265. "errstr" => $errstr);
  266. +
  267. if($this->do_debug >= 1) {
  268. +
  269. echo "SMTP -> ERROR: " . $this->error["error"] .
  270. +
  271. ": $errstr ($errno)" . $this->CRLF;
  272. +
  273. }
  274. +
  275. return false;
  276. +
  277. }
  278. +
  279.  
  280. +
  281. # sometimes the SMTP server takes a little longer to respond
  282. +
  283. # so we will give it a longer timeout for the first read
  284. +
  285. // Windows still does not have support for this timeout function
  286. +
  287. if(substr(PHP_OS, 0, 3) != "WIN")
  288. +
  289. socket_set_timeout($this->smtp_conn, $tval, 0);
  290. +
  291.  
  292. +
  293. # get any announcement stuff
  294. +
  295. $announce = $this->get_lines();
  296. +
  297.  
  298. +
  299. # set the timeout of any socket functions at 1/10 of a second
  300. +
  301. //if(function_exists("socket_set_timeout"))
  302. +
  303. // socket_set_timeout($this->smtp_conn, 0, 100000);
  304. +
  305.  
  306. +
  307. if($this->do_debug >= 2) {
  308. +
  309. echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
  310. +
  311. }
  312. +
  313.  
  314. +
  315. return true;
  316. +
  317. }
  318. +
  319.  
  320. +
  321. /**
  322. +
  323. * Performs SMTP authentication. Must be run after running the
  324. +
  325. * Hello() method. Returns true if successfully authenticated.
  326. +
  327. * @access public
  328. +
  329. * @return bool
  330. +
  331. */
  332. +
  333. function Authenticate($username, $password) {
  334. +
  335. // Start authentication
  336. +
  337. fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
  338. +
  339.  
  340. +
  341. $rply = $this->get_lines();
  342. +
  343. $code = substr($rply,0,3);
  344. +
  345.  
  346. +
  347. if($code != 334) {
  348. +
  349. $this->error =
  350. +
  351. array("error" => "AUTH not accepted from server",
  352. +
  353. "smtp_code" => $code,
  354. +
  355. "smtp_msg" => substr($rply,4));
  356. +
  357. if($this->do_debug >= 1) {
  358. +
  359. echo "SMTP -> ERROR: " . $this->error["error"] .
  360. +
  361. ": " . $rply . $this->CRLF;
  362. +
  363. }
  364. +
  365. return false;
  366. +
  367. }
  368. +
  369.  
  370. +
  371. // Send encoded username
  372. +
  373. fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
  374. +
  375.  
  376. +
  377. $rply = $this->get_lines();
  378. +
  379. $code = substr($rply,0,3);
  380. +
  381.  
  382. +
  383. if($code != 334) {
  384. +
  385. $this->error =
  386. +
  387. array("error" => "Username not accepted from server",
  388. +
  389. "smtp_code" => $code,
  390. +
  391. "smtp_msg" => substr($rply,4));
  392. +
  393. if($this->do_debug >= 1) {
  394. +
  395. echo "SMTP -> ERROR: " . $this->error["error"] .
  396. +
  397. ": " . $rply . $this->CRLF;
  398. +
  399. }
  400. +
  401. return false;
  402. +
  403. }
  404. +
  405.  
  406. +
  407. // Send encoded password
  408. +
  409. fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
  410. +
  411.  
  412. +
  413. $rply = $this->get_lines();
  414. +
  415. $code = substr($rply,0,3);
  416. +
  417.  
  418. +
  419. if($code != 235) {
  420. +
  421. $this->error =
  422. +
  423. array("error" => "Password not accepted from server",
  424. +
  425. "smtp_code" => $code,
  426. +
  427. "smtp_msg" => substr($rply,4));
  428. +
  429. if($this->do_debug >= 1) {
  430. +
  431. echo "SMTP -> ERROR: " . $this->error["error"] .
  432. +
  433. ": " . $rply . $this->CRLF;
  434. +
  435. }
  436. +
  437. return false;
  438. +
  439. }
  440. +
  441.  
  442. +
  443. return true;
  444. +
  445. }
  446. +
  447.  
  448. +
  449. /**
  450. +
  451. * Returns true if connected to a server otherwise false
  452. +
  453. * @access private
  454. +
  455. * @return bool
  456. +
  457. */
  458. +
  459. function Connected() {
  460. +
  461. if(!empty($this->smtp_conn)) {
  462. +
  463. $sock_status = socket_get_status($this->smtp_conn);
  464. +
  465. if($sock_status["eof"]) {
  466. +
  467. # hmm this is an odd situation... the socket is
  468. +
  469. # valid but we are not connected anymore
  470. +
  471. if($this->do_debug >= 1) {
  472. +
  473. echo "SMTP -> NOTICE:" . $this->CRLF .
  474. +
  475. "EOF caught while checking if connected";
  476. +
  477. }
  478. +
  479. $this->Close();
  480. +
  481. return false;
  482. +
  483. }
  484. +
  485. return true; # everything looks good
  486. +
  487. }
  488. +
  489. return false;
  490. +
  491. }
  492. +
  493.  
  494. +
  495. /**
  496. +
  497. * Closes the socket and cleans up the state of the class.
  498. +
  499. * It is not considered good to use this function without
  500. +
  501. * first trying to use QUIT.
  502. +
  503. * @access public
  504. +
  505. * @return void
  506. +
  507. */
  508. +
  509. function Close() {
  510. +
  511. $this->error = null; # so there is no confusion
  512. +
  513. $this->helo_rply = null;
  514. +
  515. if(!empty($this->smtp_conn)) {
  516. +
  517. # close the connection and cleanup
  518. +
  519. fclose($this->smtp_conn);
  520. +
  521. $this->smtp_conn = 0;
  522. +
  523. }
  524. +
  525. }
  526. +
  527.  
  528. +
  529. /*************************************************************
  530. +
  531. * SMTP COMMANDS *
  532. +
  533. *************************************************************/
  534. +
  535.  
  536. +
  537.  
  538. +
  539. /**
  540. +
  541. * Issues a data command and sends the msg_data to the server
  542. +
  543. * finializing the mail transaction. $msg_data is the message
  544. +
  545. * that is to be send with the headers. Each header needs to be
  546. +
  547. * on a single line followed by a <CRLF> with the message headers
  548. +
  549. * and the message body being seperated by and additional <CRLF>.
  550. +
  551. *
  552. +
  553. * Implements rfc 821: DATA <CRLF>
  554. +
  555. *
  556. +
  557. * SMTP CODE INTERMEDIATE: 354
  558. +
  559. * [data]
  560. +
  561. * <CRLF>.<CRLF>
  562. +
  563. * SMTP CODE SUCCESS: 250
  564. +
  565. * SMTP CODE FAILURE: 552,554,451,452
  566. +
  567. * SMTP CODE FAILURE: 451,554
  568. +
  569. * SMTP CODE ERROR : 500,501,503,421
  570. +
  571. * @access public
  572. +
  573. * @return bool
  574. +
  575. */
  576. +
  577. function Data($msg_data) {
  578. +
  579. $this->error = null; # so no confusion is caused
  580. +
  581.  
  582. +
  583. if(!$this->connected()) {
  584. +
  585. $this->error = array(
  586. +
  587. "error" => "Called Data() without being connected");
  588. +
  589. return false;
  590. +
  591. }
  592. +
  593.  
  594. +
  595. fputs($this->smtp_conn,"DATA" . $this->CRLF);
  596. +
  597.  
  598. +
  599. $rply = $this->get_lines();
  600. +
  601. $code = substr($rply,0,3);
  602. +
  603.  
  604. +
  605. if($this->do_debug >= 2) {
  606. +
  607. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  608. +
  609. }
  610. +
  611.  
  612. +
  613. if($code != 354) {
  614. +
  615. $this->error =
  616. +
  617. array("error" => "DATA command not accepted from server",
  618. +
  619. "smtp_code" => $code,
  620. +
  621. "smtp_msg" => substr($rply,4));
  622. +
  623. if($this->do_debug >= 1) {
  624. +
  625. echo "SMTP -> ERROR: " . $this->error["error"] .
  626. +
  627. ": " . $rply . $this->CRLF;
  628. +
  629. }
  630. +
  631. return false;
  632. +
  633. }
  634. +
  635.  
  636. +
  637. # the server is ready to accept data!
  638. +
  639. # according to rfc 821 we should not send more than 1000
  640. +
  641. # including the CRLF
  642. +
  643. # characters on a single line so we will break the data up
  644. +
  645. # into lines by \r and/or \n then if needed we will break
  646. +
  647. # each of those into smaller lines to fit within the limit.
  648. +
  649. # in addition we will be looking for lines that start with
  650. +
  651. # a period '.' and append and additional period '.' to that
  652. +
  653. # line. NOTE: this does not count towards are limit.
  654. +
  655.  
  656. +
  657. # normalize the line breaks so we know the explode works
  658. +
  659. $msg_data = str_replace("\r\n","\n",$msg_data);
  660. +
  661. $msg_data = str_replace("\r","\n",$msg_data);
  662. +
  663. $lines = explode("\n",$msg_data);
  664. +
  665.  
  666. +
  667. # we need to find a good way to determine is headers are
  668. +
  669. # in the msg_data or if it is a straight msg body
  670. +
  671. # currently I am assuming rfc 822 definitions of msg headers
  672. +
  673. # and if the first field of the first line (':' sperated)
  674. +
  675. # does not contain a space then it _should_ be a header
  676. +
  677. # and we can process all lines before a blank "" line as
  678. +
  679. # headers.
  680. +
  681. $field = substr($lines[0],0,strpos($lines[0],":"));
  682. +
  683. $in_headers = false;
  684. +
  685. if(!empty($field) && !strstr($field," ")) {
  686. +
  687. $in_headers = true;
  688. +
  689. }
  690. +
  691.  
  692. +
  693. $max_line_length = 998; # used below; set here for ease in change
  694. +
  695.  
  696. +
  697. while(list(,$line) = @each($lines)) {
  698. +
  699. $lines_out = null;
  700. +
  701. if($line == "" && $in_headers) {
  702. +
  703. $in_headers = false;
  704. +
  705. }
  706. +
  707. # ok we need to break this line up into several
  708. +
  709. # smaller lines
  710. +
  711. while(strlen($line) > $max_line_length) {
  712. +
  713. $pos = strrpos(substr($line,0,$max_line_length)," ");
  714. +
  715.  
  716. +
  717. # Patch to fix DOS attack
  718. +
  719. if(!$pos) {
  720. +
  721. $pos = $max_line_length - 1;
  722. +
  723. }
  724. +
  725.  
  726. +
  727. $lines_out[] = substr($line,0,$pos);
  728. +
  729. $line = substr($line,$pos + 1);
  730. +
  731. # if we are processing headers we need to
  732. +
  733. # add a LWSP-char to the front of the new line
  734. +
  735. # rfc 822 on long msg headers
  736. +
  737. if($in_headers) {
  738. +
  739. $line = "\t" . $line;
  740. +
  741. }
  742. +
  743. }
  744. +
  745. $lines_out[] = $line;
  746. +
  747.  
  748. +
  749. # now send the lines to the server
  750. +
  751. while(list(,$line_out) = @each($lines_out)) {
  752. +
  753. if(strlen($line_out) > 0)
  754. +
  755. {
  756. +
  757. if(substr($line_out, 0, 1) == ".") {
  758. +
  759. $line_out = "." . $line_out;
  760. +
  761. }
  762. +
  763. }
  764. +
  765. fputs($this->smtp_conn,$line_out . $this->CRLF);
  766. +
  767. }
  768. +
  769. }
  770. +
  771.  
  772. +
  773. # ok all the message data has been sent so lets get this
  774. +
  775. # over with aleady
  776. +
  777. fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
  778. +
  779.  
  780. +
  781. $rply = $this->get_lines();
  782. +
  783. $code = substr($rply,0,3);
  784. +
  785.  
  786. +
  787. if($this->do_debug >= 2) {
  788. +
  789. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  790. +
  791. }
  792. +
  793.  
  794. +
  795. if($code != 250) {
  796. +
  797. $this->error =
  798. +
  799. array("error" => "DATA not accepted from server",
  800. +
  801. "smtp_code" => $code,
  802. +
  803. "smtp_msg" => substr($rply,4));
  804. +
  805. if($this->do_debug >= 1) {
  806. +
  807. echo "SMTP -> ERROR: " . $this->error["error"] .
  808. +
  809. ": " . $rply . $this->CRLF;
  810. +
  811. }
  812. +
  813. return false;
  814. +
  815. }
  816. +
  817. return true;
  818. +
  819. }
  820. +
  821.  
  822. +
  823. /**
  824. +
  825. * Expand takes the name and asks the server to list all the
  826. +
  827. * people who are members of the _list_. Expand will return
  828. +
  829. * back and array of the result or false if an error occurs.
  830. +
  831. * Each value in the array returned has the format of:
  832. +
  833. * [ <full-name> <sp> ] <path>
  834. +
  835. * The definition of <path> is defined in rfc 821
  836. +
  837. *
  838. +
  839. * Implements rfc 821: EXPN <SP> <string> <CRLF>
  840. +
  841. *
  842. +
  843. * SMTP CODE SUCCESS: 250
  844. +
  845. * SMTP CODE FAILURE: 550
  846. +
  847. * SMTP CODE ERROR : 500,501,502,504,421
  848. +
  849. * @access public
  850. +
  851. * @return string array
  852. +
  853. */
  854. +
  855. function Expand($name) {
  856. +
  857. $this->error = null; # so no confusion is caused
  858. +
  859.  
  860. +
  861. if(!$this->connected()) {
  862. +
  863. $this->error = array(
  864. +
  865. "error" => "Called Expand() without being connected");
  866. +
  867. return false;
  868. +
  869. }
  870. +
  871.  
  872. +
  873. fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
  874. +
  875.  
  876. +
  877. $rply = $this->get_lines();
  878. +
  879. $code = substr($rply,0,3);
  880. +
  881.  
  882. +
  883. if($this->do_debug >= 2) {
  884. +
  885. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  886. +
  887. }
  888. +
  889.  
  890. +
  891. if($code != 250) {
  892. +
  893. $this->error =
  894. +
  895. array("error" => "EXPN not accepted from server",
  896. +
  897. "smtp_code" => $code,
  898. +
  899. "smtp_msg" => substr($rply,4));
  900. +
  901. if($this->do_debug >= 1) {
  902. +
  903. echo "SMTP -> ERROR: " . $this->error["error"] .
  904. +
  905. ": " . $rply . $this->CRLF;
  906. +
  907. }
  908. +
  909. return false;
  910. +
  911. }
  912. +
  913.  
  914. +
  915. # parse the reply and place in our array to return to user
  916. +
  917. $entries = explode($this->CRLF,$rply);
  918. +
  919. while(list(,$l) = @each($entries)) {
  920. +
  921. $list[] = substr($l,4);
  922. +
  923. }
  924. +
  925.  
  926. +
  927. return $list;
  928. +
  929. }
  930. +
  931.  
  932. +
  933. /**
  934. +
  935. * Sends the HELO command to the smtp server.
  936. +
  937. * This makes sure that we and the server are in
  938. +
  939. * the same known state.
  940. +
  941. *
  942. +
  943. * Implements from rfc 821: HELO <SP> <domain> <CRLF>
  944. +
  945. *
  946. +
  947. * SMTP CODE SUCCESS: 250
  948. +
  949. * SMTP CODE ERROR : 500, 501, 504, 421
  950. +
  951. * @access public
  952. +
  953. * @return bool
  954. +
  955. */
  956. +
  957. function Hello($host="") {
  958. +
  959. $this->error = null; # so no confusion is caused
  960. +
  961.  
  962. +
  963. if(!$this->connected()) {
  964. +
  965. $this->error = array(
  966. +
  967. "error" => "Called Hello() without being connected");
  968. +
  969. return false;
  970. +
  971. }
  972. +
  973.  
  974. +
  975. # if a hostname for the HELO was not specified determine
  976. +
  977. # a suitable one to send
  978. +
  979. if(empty($host)) {
  980. +
  981. # we need to determine some sort of appopiate default
  982. +
  983. # to send to the server
  984. +
  985. $host = "localhost";
  986. +
  987. }
  988. +
  989.  
  990. +
  991. // Send extended hello first (RFC 2821)
  992. +
  993. if(!$this->SendHello("EHLO", $host))
  994. +
  995. {
  996. +
  997. if(!$this->SendHello("HELO", $host))
  998. +
  999. return false;
  1000. +
  1001. }
  1002. +
  1003.  
  1004. +
  1005. return true;
  1006. +
  1007. }
  1008. +
  1009.  
  1010. +
  1011. /**
  1012. +
  1013. * Sends a HELO/EHLO command.
  1014. +
  1015. * @access private
  1016. +
  1017. * @return bool
  1018. +
  1019. */
  1020. +
  1021. function SendHello($hello, $host) {
  1022. +
  1023. fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
  1024. +
  1025.  
  1026. +
  1027. $rply = $this->get_lines();
  1028. +
  1029. $code = substr($rply,0,3);
  1030. +
  1031.  
  1032. +
  1033. if($this->do_debug >= 2) {
  1034. +
  1035. echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
  1036. +
  1037. }
  1038. +
  1039.  
  1040. +
  1041. if($code != 250) {
  1042. +
  1043. $this->error =
  1044. +
  1045. array("error" => $hello . " not accepted from server",
  1046. +
  1047. "smtp_code" => $code,
  1048. +
  1049. "smtp_msg" => substr($rply,4));
  1050. +
  1051. if($this->do_debug >= 1) {
  1052. +
  1053. echo "SMTP -> ERROR: " . $this->error["error"] .
  1054. +
  1055. ": " . $rply . $this->CRLF;
  1056. +
  1057. }
  1058. +
  1059. return false;
  1060. +
  1061. }
  1062. +
  1063.  
  1064. +
  1065. $this->helo_rply = $rply;
  1066. +
  1067.  
  1068. +
  1069. return true;
  1070. +
  1071. }
  1072. +
  1073.  
  1074. +
  1075. /**
  1076. +
  1077. * Gets help information on the keyword specified. If the keyword
  1078. +
  1079. * is not specified then returns generic help, ussually contianing
  1080. +
  1081. * A list of keywords that help is available on. This function
  1082. +
  1083. * returns the results back to the user. It is up to the user to
  1084. +
  1085. * handle the returned data. If an error occurs then false is
  1086. +
  1087. * returned with $this->error set appropiately.
  1088. +
  1089. *
  1090. +
  1091. * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
  1092. +
  1093. *
  1094. +
  1095. * SMTP CODE SUCCESS: 211,214
  1096. +
  1097. * SMTP CODE ERROR : 500,501,502,504,421
  1098. +
  1099. * @access public
  1100. +
  1101. * @return string
  1102. +
  1103. */
  1104. +
  1105. function Help($keyword="") {
  1106. +
  1107. $this->error = null; # to avoid confusion
  1108. +
  1109.  
  1110. +
  1111. if(!$this->connected()) {
  1112. +
  1113. $this->error = array(
  1114. +
  1115. "error" => "Called Help() without being connected");
  1116. +
  1117. return false;
  1118. +
  1119. }
  1120. +
  1121.  
  1122. +
  1123. $extra = "";
  1124. +
  1125. if(!empty($keyword)) {
  1126. +
  1127. $extra = " " . $keyword;
  1128. +
  1129. }
  1130. +
  1131.  
  1132. +
  1133. fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
  1134. +
  1135.  
  1136. +
  1137. $rply = $this->get_lines();
  1138. +
  1139. $code = substr($rply,0,3);
  1140. +
  1141.  
  1142. +
  1143. if($this->do_debug >= 2) {
  1144. +
  1145. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1146. +
  1147. }
  1148. +
  1149.  
  1150. +
  1151. if($code != 211 && $code != 214) {
  1152. +
  1153. $this->error =
  1154. +
  1155. array("error" => "HELP not accepted from server",
  1156. +
  1157. "smtp_code" => $code,
  1158. +
  1159. "smtp_msg" => substr($rply,4));
  1160. +
  1161. if($this->do_debug >= 1) {
  1162. +
  1163. echo "SMTP -> ERROR: " . $this->error["error"] .
  1164. +
  1165. ": " . $rply . $this->CRLF;
  1166. +
  1167. }
  1168. +
  1169. return false;
  1170. +
  1171. }
  1172. +
  1173.  
  1174. +
  1175. return $rply;
  1176. +
  1177. }
  1178. +
  1179.  
  1180. +
  1181. /**
  1182. +
  1183. * Starts a mail transaction from the email address specified in
  1184. +
  1185. * $from. Returns true if successful or false otherwise. If True
  1186. +
  1187. * the mail transaction is started and then one or more Recipient
  1188. +
  1189. * commands may be called followed by a Data command.
  1190. +
  1191. *
  1192. +
  1193. * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
  1194. +
  1195. *
  1196. +
  1197. * SMTP CODE SUCCESS: 250
  1198. +
  1199. * SMTP CODE SUCCESS: 552,451,452
  1200. +
  1201. * SMTP CODE SUCCESS: 500,501,421
  1202. +
  1203. * @access public
  1204. +
  1205. * @return bool
  1206. +
  1207. */
  1208. +
  1209. function Mail($from) {
  1210. +
  1211. $this->error = null; # so no confusion is caused
  1212. +
  1213.  
  1214. +
  1215. if(!$this->connected()) {
  1216. +
  1217. $this->error = array(
  1218. +
  1219. "error" => "Called Mail() without being connected");
  1220. +
  1221. return false;
  1222. +
  1223. }
  1224. +
  1225.  
  1226. +
  1227. $useVerp = ($this->do_verp ? "XVERP" : "");
  1228. +
  1229. fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
  1230. +
  1231.  
  1232. +
  1233. $rply = $this->get_lines();
  1234. +
  1235. $code = substr($rply,0,3);
  1236. +
  1237.  
  1238. +
  1239. if($this->do_debug >= 2) {
  1240. +
  1241. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1242. +
  1243. }
  1244. +
  1245.  
  1246. +
  1247. if($code != 250) {
  1248. +
  1249. $this->error =
  1250. +
  1251. array("error" => "MAIL not accepted from server",
  1252. +
  1253. "smtp_code" => $code,
  1254. +
  1255. "smtp_msg" => substr($rply,4));
  1256. +
  1257. if($this->do_debug >= 1) {
  1258. +
  1259. echo "SMTP -> ERROR: " . $this->error["error"] .
  1260. +
  1261. ": " . $rply . $this->CRLF;
  1262. +
  1263. }
  1264. +
  1265. return false;
  1266. +
  1267. }
  1268. +
  1269. return true;
  1270. +
  1271. }
  1272. +
  1273.  
  1274. +
  1275. /**
  1276. +
  1277. * Sends the command NOOP to the SMTP server.
  1278. +
  1279. *
  1280. +
  1281. * Implements from rfc 821: NOOP <CRLF>
  1282. +
  1283. *
  1284. +
  1285. * SMTP CODE SUCCESS: 250
  1286. +
  1287. * SMTP CODE ERROR : 500, 421
  1288. +
  1289. * @access public
  1290. +
  1291. * @return bool
  1292. +
  1293. */
  1294. +
  1295. function Noop() {
  1296. +
  1297. $this->error = null; # so no confusion is caused
  1298. +
  1299.  
  1300. +
  1301. if(!$this->connected()) {
  1302. +
  1303. $this->error = array(
  1304. +
  1305. "error" => "Called Noop() without being connected");
  1306. +
  1307. return false;
  1308. +
  1309. }
  1310. +
  1311.  
  1312. +
  1313. fputs($this->smtp_conn,"NOOP" . $this->CRLF);
  1314. +
  1315.  
  1316. +
  1317. $rply = $this->get_lines();
  1318. +
  1319. $code = substr($rply,0,3);
  1320. +
  1321.  
  1322. +
  1323. if($this->do_debug >= 2) {
  1324. +
  1325. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1326. +
  1327. }
  1328. +
  1329.  
  1330. +
  1331. if($code != 250) {
  1332. +
  1333. $this->error =
  1334. +
  1335. array("error" => "NOOP not accepted from server",
  1336. +
  1337. "smtp_code" => $code,
  1338. +
  1339. "smtp_msg" => substr($rply,4));
  1340. +
  1341. if($this->do_debug >= 1) {
  1342. +
  1343. echo "SMTP -> ERROR: " . $this->error["error"] .
  1344. +
  1345. ": " . $rply . $this->CRLF;
  1346. +
  1347. }
  1348. +
  1349. return false;
  1350. +
  1351. }
  1352. +
  1353. return true;
  1354. +
  1355. }
  1356. +
  1357.  
  1358. +
  1359. /**
  1360. +
  1361. * Sends the quit command to the server and then closes the socket
  1362. +
  1363. * if there is no error or the $close_on_error argument is true.
  1364. +
  1365. *
  1366. +
  1367. * Implements from rfc 821: QUIT <CRLF>
  1368. +
  1369. *
  1370. +
  1371. * SMTP CODE SUCCESS: 221
  1372. +
  1373. * SMTP CODE ERROR : 500
  1374. +
  1375. * @access public
  1376. +
  1377. * @return bool
  1378. +
  1379. */
  1380. +
  1381. function Quit($close_on_error=true) {
  1382. +
  1383. $this->error = null; # so there is no confusion
  1384. +
  1385.  
  1386. +
  1387. if(!$this->connected()) {
  1388. +
  1389. $this->error = array(
  1390. +
  1391. "error" => "Called Quit() without being connected");
  1392. +
  1393. return false;
  1394. +
  1395. }
  1396. +
  1397.  
  1398. +
  1399. # send the quit command to the server
  1400. +
  1401. fputs($this->smtp_conn,"quit" . $this->CRLF);
  1402. +
  1403.  
  1404. +
  1405. # get any good-bye messages
  1406. +
  1407. $byemsg = $this->get_lines();
  1408. +
  1409.  
  1410. +
  1411. if($this->do_debug >= 2) {
  1412. +
  1413. echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
  1414. +
  1415. }
  1416. +
  1417.  
  1418. +
  1419. $rval = true;
  1420. +
  1421. $e = null;
  1422. +
  1423.  
  1424. +
  1425. $code = substr($byemsg,0,3);
  1426. +
  1427. if($code != 221) {
  1428. +
  1429. # use e as a tmp var cause Close will overwrite $this->error
  1430. +
  1431. $e = array("error" => "SMTP server rejected quit command",
  1432. +
  1433. "smtp_code" => $code,
  1434. +
  1435. "smtp_rply" => substr($byemsg,4));
  1436. +
  1437. $rval = false;
  1438. +
  1439. if($this->do_debug >= 1) {
  1440. +
  1441. echo "SMTP -> ERROR: " . $e["error"] . ": " .
  1442. +
  1443. $byemsg . $this->CRLF;
  1444. +
  1445. }
  1446. +
  1447. }
  1448. +
  1449.  
  1450. +
  1451. if(empty($e) || $close_on_error) {
  1452. +
  1453. $this->Close();
  1454. +
  1455. }
  1456. +
  1457.  
  1458. +
  1459. return $rval;
  1460. +
  1461. }
  1462. +
  1463.  
  1464. +
  1465. /**
  1466. +
  1467. * Sends the command RCPT to the SMTP server with the TO: argument of $to.
  1468. +
  1469. * Returns true if the recipient was accepted false if it was rejected.
  1470. +
  1471. *
  1472. +
  1473. * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
  1474. +
  1475. *
  1476. +
  1477. * SMTP CODE SUCCESS: 250,251
  1478. +
  1479. * SMTP CODE FAILURE: 550,551,552,553,450,451,452
  1480. +
  1481. * SMTP CODE ERROR : 500,501,503,421
  1482. +
  1483. * @access public
  1484. +
  1485. * @return bool
  1486. +
  1487. */
  1488. +
  1489. function Recipient($to) {
  1490. +
  1491. $this->error = null; # so no confusion is caused
  1492. +
  1493.  
  1494. +
  1495. if(!$this->connected()) {
  1496. +
  1497. $this->error = array(
  1498. +
  1499. "error" => "Called Recipient() without being connected");
  1500. +
  1501. return false;
  1502. +
  1503. }
  1504. +
  1505.  
  1506. +
  1507. fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
  1508. +
  1509.  
  1510. +
  1511. $rply = $this->get_lines();
  1512. +
  1513. $code = substr($rply,0,3);
  1514. +
  1515.  
  1516. +
  1517. if($this->do_debug >= 2) {
  1518. +
  1519. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1520. +
  1521. }
  1522. +
  1523.  
  1524. +
  1525. if($code != 250 && $code != 251) {
  1526. +
  1527. $this->error =
  1528. +
  1529. array("error" => "RCPT not accepted from server",
  1530. +
  1531. "smtp_code" => $code,
  1532. +
  1533. "smtp_msg" => substr($rply,4));
  1534. +
  1535. if($this->do_debug >= 1) {
  1536. +
  1537. echo "SMTP -> ERROR: " . $this->error["error"] .
  1538. +
  1539. ": " . $rply . $this->CRLF;
  1540. +
  1541. }
  1542. +
  1543. return false;
  1544. +
  1545. }
  1546. +
  1547. return true;
  1548. +
  1549. }
  1550. +
  1551.  
  1552. +
  1553. /**
  1554. +
  1555. * Sends the RSET command to abort and transaction that is
  1556. +
  1557. * currently in progress. Returns true if successful false
  1558. +
  1559. * otherwise.
  1560. +
  1561. *
  1562. +
  1563. * Implements rfc 821: RSET <CRLF>
  1564. +
  1565. *
  1566. +
  1567. * SMTP CODE SUCCESS: 250
  1568. +
  1569. * SMTP CODE ERROR : 500,501,504,421
  1570. +
  1571. * @access public
  1572. +
  1573. * @return bool
  1574. +
  1575. */
  1576. +
  1577. function Reset() {
  1578. +
  1579. $this->error = null; # so no confusion is caused
  1580. +
  1581.  
  1582. +
  1583. if(!$this->connected()) {
  1584. +
  1585. $this->error = array(
  1586. +
  1587. "error" => "Called Reset() without being connected");
  1588. +
  1589. return false;
  1590. +
  1591. }
  1592. +
  1593.  
  1594. +
  1595. fputs($this->smtp_conn,"RSET" . $this->CRLF);
  1596. +
  1597.  
  1598. +
  1599. $rply = $this->get_lines();
  1600. +
  1601. $code = substr($rply,0,3);
  1602. +
  1603.  
  1604. +
  1605. if($this->do_debug >= 2) {
  1606. +
  1607. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1608. +
  1609. }
  1610. +
  1611.  
  1612. +
  1613. if($code != 250) {
  1614. +
  1615. $this->error =
  1616. +
  1617. array("error" => "RSET failed",
  1618. +
  1619. "smtp_code" => $code,
  1620. +
  1621. "smtp_msg" => substr($rply,4));
  1622. +
  1623. if($this->do_debug >= 1) {
  1624. +
  1625. echo "SMTP -> ERROR: " . $this->error["error"] .
  1626. +
  1627. ": " . $rply . $this->CRLF;
  1628. +
  1629. }
  1630. +
  1631. return false;
  1632. +
  1633. }
  1634. +
  1635.  
  1636. +
  1637. return true;
  1638. +
  1639. }
  1640. +
  1641.  
  1642. +
  1643. /**
  1644. +
  1645. * Starts a mail transaction from the email address specified in
  1646. +
  1647. * $from. Returns true if successful or false otherwise. If True
  1648. +
  1649. * the mail transaction is started and then one or more Recipient
  1650. +
  1651. * commands may be called followed by a Data command. This command
  1652. +
  1653. * will send the message to the users terminal if they are logged
  1654. +
  1655. * in.
  1656. +
  1657. *
  1658. +
  1659. * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
  1660. +
  1661. *
  1662. +
  1663. * SMTP CODE SUCCESS: 250
  1664. +
  1665. * SMTP CODE SUCCESS: 552,451,452
  1666. +
  1667. * SMTP CODE SUCCESS: 500,501,502,421
  1668. +
  1669. * @access public
  1670. +
  1671. * @return bool
  1672. +
  1673. */
  1674. +
  1675. function Send($from) {
  1676. +
  1677. $this->error = null; # so no confusion is caused
  1678. +
  1679.  
  1680. +
  1681. if(!$this->connected()) {
  1682. +
  1683. $this->error = array(
  1684. +
  1685. "error" => "Called Send() without being connected");
  1686. +
  1687. return false;
  1688. +
  1689. }
  1690. +
  1691.  
  1692. +
  1693. fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
  1694. +
  1695.  
  1696. +
  1697. $rply = $this->get_lines();
  1698. +
  1699. $code = substr($rply,0,3);
  1700. +
  1701.  
  1702. +
  1703. if($this->do_debug >= 2) {
  1704. +
  1705. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1706. +
  1707. }
  1708. +
  1709.  
  1710. +
  1711. if($code != 250) {
  1712. +
  1713. $this->error =
  1714. +
  1715. array("error" => "SEND not accepted from server",
  1716. +
  1717. "smtp_code" => $code,
  1718. +
  1719. "smtp_msg" => substr($rply,4));
  1720. +
  1721. if($this->do_debug >= 1) {
  1722. +
  1723. echo "SMTP -> ERROR: " . $this->error["error"] .
  1724. +
  1725. ": " . $rply . $this->CRLF;
  1726. +
  1727. }
  1728. +
  1729. return false;
  1730. +
  1731. }
  1732. +
  1733. return true;
  1734. +
  1735. }
  1736. +
  1737.  
  1738. +
  1739. /**
  1740. +
  1741. * Starts a mail transaction from the email address specified in
  1742. +
  1743. * $from. Returns true if successful or false otherwise. If True
  1744. +
  1745. * the mail transaction is started and then one or more Recipient
  1746. +
  1747. * commands may be called followed by a Data command. This command
  1748. +
  1749. * will send the message to the users terminal if they are logged
  1750. +
  1751. * in and send them an email.
  1752. +
  1753. *
  1754. +
  1755. * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
  1756. +
  1757. *
  1758. +
  1759. * SMTP CODE SUCCESS: 250
  1760. +
  1761. * SMTP CODE SUCCESS: 552,451,452
  1762. +
  1763. * SMTP CODE SUCCESS: 500,501,502,421
  1764. +
  1765. * @access public
  1766. +
  1767. * @return bool
  1768. +
  1769. */
  1770. +
  1771. function SendAndMail($from) {
  1772. +
  1773. $this->error = null; # so no confusion is caused
  1774. +
  1775.  
  1776. +
  1777. if(!$this->connected()) {
  1778. +
  1779. $this->error = array(
  1780. +
  1781. "error" => "Called SendAndMail() without being connected");
  1782. +
  1783. return false;
  1784. +
  1785. }
  1786. +
  1787.  
  1788. +
  1789. fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
  1790. +
  1791.  
  1792. +
  1793. $rply = $this->get_lines();
  1794. +
  1795. $code = substr($rply,0,3);
  1796. +
  1797.  
  1798. +
  1799. if($this->do_debug >= 2) {
  1800. +
  1801. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1802. +
  1803. }
  1804. +
  1805.  
  1806. +
  1807. if($code != 250) {
  1808. +
  1809. $this->error =
  1810. +
  1811. array("error" => "SAML not accepted from server",
  1812. +
  1813. "smtp_code" => $code,
  1814. +
  1815. "smtp_msg" => substr($rply,4));
  1816. +
  1817. if($this->do_debug >= 1) {
  1818. +
  1819. echo "SMTP -> ERROR: " . $this->error["error"] .
  1820. +
  1821. ": " . $rply . $this->CRLF;
  1822. +
  1823. }
  1824. +
  1825. return false;
  1826. +
  1827. }
  1828. +
  1829. return true;
  1830. +
  1831. }
  1832. +
  1833.  
  1834. +
  1835. /**
  1836. +
  1837. * Starts a mail transaction from the email address specified in
  1838. +
  1839. * $from. Returns true if successful or false otherwise. If True
  1840. +
  1841. * the mail transaction is started and then one or more Recipient
  1842. +
  1843. * commands may be called followed by a Data command. This command
  1844. +
  1845. * will send the message to the users terminal if they are logged
  1846. +
  1847. * in or mail it to them if they are not.
  1848. +
  1849. *
  1850. +
  1851. * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
  1852. +
  1853. *
  1854. +
  1855. * SMTP CODE SUCCESS: 250
  1856. +
  1857. * SMTP CODE SUCCESS: 552,451,452
  1858. +
  1859. * SMTP CODE SUCCESS: 500,501,502,421
  1860. +
  1861. * @access public
  1862. +
  1863. * @return bool
  1864. +
  1865. */
  1866. +
  1867. function SendOrMail($from) {
  1868. +
  1869. $this->error = null; # so no confusion is caused
  1870. +
  1871.  
  1872. +
  1873. if(!$this->connected()) {
  1874. +
  1875. $this->error = array(
  1876. +
  1877. "error" => "Called SendOrMail() without being connected");
  1878. +
  1879. return false;
  1880. +
  1881. }
  1882. +
  1883.  
  1884. +
  1885. fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
  1886. +
  1887.  
  1888. +
  1889. $rply = $this->get_lines();
  1890. +
  1891. $code = substr($rply,0,3);
  1892. +
  1893.  
  1894. +
  1895. if($this->do_debug >= 2) {
  1896. +
  1897. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  1898. +
  1899. }
  1900. +
  1901.  
  1902. +
  1903. if($code != 250) {
  1904. +
  1905. $this->error =
  1906. +
  1907. array("error" => "SOML not accepted from server",
  1908. +
  1909. "smtp_code" => $code,
  1910. +
  1911. "smtp_msg" => substr($rply,4));
  1912. +
  1913. if($this->do_debug >= 1) {
  1914. +
  1915. echo "SMTP -> ERROR: " . $this->error["error"] .
  1916. +
  1917. ": " . $rply . $this->CRLF;
  1918. +
  1919. }
  1920. +
  1921. return false;
  1922. +
  1923. }
  1924. +
  1925. return true;
  1926. +
  1927. }
  1928. +
  1929.  
  1930. +
  1931. /**
  1932. +
  1933. * This is an optional command for SMTP that this class does not
  1934. +
  1935. * support. This method is here to make the RFC821 Definition
  1936. +
  1937. * complete for this class and __may__ be implimented in the future
  1938. +
  1939. *
  1940. +
  1941. * Implements from rfc 821: TURN <CRLF>
  1942. +
  1943. *
  1944. +
  1945. * SMTP CODE SUCCESS: 250
  1946. +
  1947. * SMTP CODE FAILURE: 502
  1948. +
  1949. * SMTP CODE ERROR : 500, 503
  1950. +
  1951. * @access public
  1952. +
  1953. * @return bool
  1954. +
  1955. */
  1956. +
  1957. function Turn() {
  1958. +
  1959. $this->error = array("error" => "This method, TURN, of the SMTP ".
  1960. +
  1961. "is not implemented");
  1962. +
  1963. if($this->do_debug >= 1) {
  1964. +
  1965. echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
  1966. +
  1967. }
  1968. +
  1969. return false;
  1970. +
  1971. }
  1972. +
  1973.  
  1974. +
  1975. /**
  1976. +
  1977. * Verifies that the name is recognized by the server.
  1978. +
  1979. * Returns false if the name could not be verified otherwise
  1980. +
  1981. * the response from the server is returned.
  1982. +
  1983. *
  1984. +
  1985. * Implements rfc 821: VRFY <SP> <string> <CRLF>
  1986. +
  1987. *
  1988. +
  1989. * SMTP CODE SUCCESS: 250,251
  1990. +
  1991. * SMTP CODE FAILURE: 550,551,553
  1992. +
  1993. * SMTP CODE ERROR : 500,501,502,421
  1994. +
  1995. * @access public
  1996. +
  1997. * @return int
  1998. +
  1999. */
  2000. +
  2001. function Verify($name) {
  2002. +
  2003. $this->error = null; # so no confusion is caused
  2004. +
  2005.  
  2006. +
  2007. if(!$this->connected()) {
  2008. +
  2009. $this->error = array(
  2010. +
  2011. "error" => "Called Verify() without being connected");
  2012. +
  2013. return false;
  2014. +
  2015. }
  2016. +
  2017.  
  2018. +
  2019. fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
  2020. +
  2021.  
  2022. +
  2023. $rply = $this->get_lines();
  2024. +
  2025. $code = substr($rply,0,3);
  2026. +
  2027.  
  2028. +
  2029. if($this->do_debug >= 2) {
  2030. +
  2031. echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
  2032. +
  2033. }
  2034. +
  2035.  
  2036. +
  2037. if($code != 250 && $code != 251) {
  2038. +
  2039. $this->error =
  2040. +
  2041. array("error" => "VRFY failed on name '$name'",
  2042. +
  2043. "smtp_code" => $code,
  2044. +
  2045. "smtp_msg" => substr($rply,4));
  2046. +
  2047. if($this->do_debug >= 1) {
  2048. +
  2049. echo "SMTP -> ERROR: " . $this->error["error"] .
  2050. +
  2051. ": " . $rply . $this->CRLF;
  2052. +
  2053. }
  2054. +
  2055. return false;
  2056. +
  2057. }
  2058. +
  2059. return $rply;
  2060. +
  2061. }
  2062. +
  2063.  
  2064. +
  2065. /*****************************************************************
  2066. +
  2067. * INTERNAL FUNCTIONS *
  2068. +
  2069. ******************************************************************/
  2070. +
  2071.  
  2072. +
  2073.  
  2074. +
  2075. /**
  2076. +
  2077. * Read in as many lines as possible
  2078. +
  2079. * either before eof or socket timeout occurs on the operation.
  2080. +
  2081. * With SMTP we can tell if we have more lines to read if the
  2082. +
  2083. * 4th character is '-' symbol. If it is a space then we don't
  2084. +
  2085. * need to read anything else.
  2086. +
  2087. * @access private
  2088. +
  2089. * @return string
  2090. +
  2091. */
  2092. +
  2093. function get_lines() {
  2094. +
  2095. $data = "";
  2096. +
  2097. while($str = @fgets($this->smtp_conn,515)) {
  2098. +
  2099. if($this->do_debug >= 4) {
  2100. +
  2101. echo "SMTP -> get_lines(): \$data was \"$data\"" .
  2102. +
  2103. $this->CRLF;
  2104. +
  2105. echo "SMTP -> get_lines(): \$str is \"$str\"" .
  2106. +
  2107. $this->CRLF;
  2108. +
  2109. }
  2110. +
  2111. $data .= $str;
  2112. +
  2113. if($this->do_debug >= 4) {
  2114. +
  2115. echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
  2116. +
  2117. }
  2118. +
  2119. # if the 4th character is a space then we are done reading
  2120. +
  2121. # so just break the loop
  2122. +
  2123. if(substr($str,3,1) == " ") { break; }
  2124. +
  2125. }
  2126. +
  2127. return $data;
  2128. +
  2129. }
  2130. +
  2131.  
  2132. +
  2133. }
  2134. +
  2135.  
  2136. +
  2137.  
  2138. +
  2139. ?>
  2140. +
+
+

+ Documentation generated on Thu, 02 Apr 2009 21:19:51 -0400 by phpDocumentor 1.3.0RC3 +

+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/blank.html b/plugin/PHPMailer_v2.0.4/phpdocs/blank.html new file mode 100644 index 000000000..04842f8d4 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/blank.html @@ -0,0 +1,13 @@ + + + PHPMailer version 2.0.4 + + + + +

PHPMailer version 2.0.4

+Welcome to PHPMailer!
+
+This documentation was generated by phpDocumentor v1.3.0RC3
+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/classtrees_PHPMailer.html b/plugin/PHPMailer_v2.0.4/phpdocs/classtrees_PHPMailer.html new file mode 100644 index 000000000..46ff94bc7 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/classtrees_PHPMailer.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + +

+ +

+

Root class PHPMailer

+ + +

Root class POP3

+ + +

Root class SMTP

+ + +

+ Documentation generated on Thu, 02 Apr 2009 21:19:46 -0400 by phpDocumentor 1.3.0RC3 +

+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/elementindex.html b/plugin/PHPMailer_v2.0.4/phpdocs/elementindex.html new file mode 100644 index 000000000..b1526d2dc --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/elementindex.html @@ -0,0 +1,1049 @@ + + + + + + + + + + + +

Full index

+

Package indexes

+ +
+
+ a + b + c + d + e + f + g + h + i + l + 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.
+
+
+ $attachment +
+
+
PHPMailer::$attachment in class.phpmailer.php
+
+
+ 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.
+
+
+ Authorise +
+
+
POP3::Authorise() in class.pop3.php
+
Combination of public events - connect, login, disconnect
+
+
+ +
+
b
+ +
+
+
+
+ $bcc +
+
+
PHPMailer::$bcc in class.phpmailer.php
+
+
+ $Body +
+
+
PHPMailer::$Body in class.phpmailer.php
+
Sets the Body of the message. This can be either an HTML or text body.
+
+
+ $boundary +
+
+
PHPMailer::$boundary in class.phpmailer.php
+
+
+ +
+
c
+ +
+
+
+
+ $cc +
+
+
PHPMailer::$cc in class.phpmailer.php
+
+
+ $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
+
+
+ $CRLF +
+
+
POP3::$CRLF in class.pop3.php
+
POP3 Carriage Return + Line Feed
+
+
+ $CustomHeader +
+
+
PHPMailer::$CustomHeader in class.phpmailer.php
+
+
+ catchWarning +
+
+
POP3::catchWarning() in class.pop3.php
+
Takes over from PHP for the socket warning handler
+
+
+ checkResponse +
+
+
POP3::checkResponse() in class.pop3.php
+
Checks the POP3 server response for +OK or -ERR
+
+
+ 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.
+
+
+ Connect +
+
+
POP3::Connect() in class.pop3.php
+
Connect to the POP3 server
+
+
+ class.phpmailer.php +
+
+
class.phpmailer.php in class.phpmailer.php
+
+
+ class.pop3.php +
+
+
class.pop3.php in class.pop3.php
+
+
+ class.smtp.php +
+
+
class.smtp.php in class.smtp.php
+
+
+ +
+
d
+ +
+
+
+
+ $do_debug +
+
+
SMTP::$do_debug in class.smtp.php
+
Sets whether debugging is turned on
+
+
+ $do_debug +
+
+
POP3::$do_debug in class.pop3.php
+
Displaying Debug warnings? (0 = now, 1+ = yes)
+
+
+ $do_verp +
+
+
SMTP::$do_verp in class.smtp.php
+
Sets VERP use on/off (default is off)
+
+
+ Data +
+
+
SMTP::Data() in class.smtp.php
+
Issues a data command and sends the msg_data to the server
+
+
+ Disconnect +
+
+
POP3::Disconnect() in class.pop3.php
+
Disconnect from the POP3 server
+
+
+ displayErrors +
+
+
POP3::displayErrors() in class.pop3.php
+
If debug is enabled, display the error message array
+
+
+ +
+
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.
+
+
+ $error_count +
+
+
PHPMailer::$error_count in class.phpmailer.php
+
+
+ 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.
+
+
+ +
+
g
+ +
+
+
+
+ getFile +
+
+
PHPMailer::getFile() in class.phpmailer.php
+
Read a file from a supplied filename and return it.
+
+
+ getResponse +
+
+
POP3::getResponse() in class.pop3.php
+
Get the socket response back.
+
+
+ +
+
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").
+
+
+ $host +
+
+
POP3::$host in class.pop3.php
+
POP3 Mail Server
+
+
+ $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'.
+
+
+ HeaderLine +
+
+
PHPMailer::HeaderLine() in class.phpmailer.php
+
+
+ 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.
+
+
+ +
+
l
+ +
+
+
+
+ $language +
+
+
PHPMailer::$language in class.phpmailer.php
+
+
+ $LE +
+
+
PHPMailer::$LE in class.phpmailer.php
+
+
+ Login +
+
+
POP3::Login() in class.pop3.php
+
Login to the POP3 server (does not support APOP yet)
+
+
+ +
+
m
+ +
+
+
+
+ $Mailer +
+
+
PHPMailer::$Mailer in class.phpmailer.php
+
Method to send mail: ("mail", "sendmail", or "smtp").
+
+
+ $MessageID +
+
+
PHPMailer::$MessageID in class.phpmailer.php
+
Sets the message ID to be used in the Message-Id header.
+
+
+ $message_type +
+
+
PHPMailer::$message_type in class.phpmailer.php
+
+
+ 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.
+
+
+ MsgHTML +
+
+
PHPMailer::MsgHTML() in class.phpmailer.php
+
Evaluates the message and returns modifications for inline images and backgrounds
+
+
+ +
+
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.
+
+
+ $password +
+
+
POP3::$password in class.pop3.php
+
POP3 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.
+
+
+ $POP3_PORT +
+
+
POP3::$POP3_PORT in class.pop3.php
+
Default POP3 port
+
+
+ $POP3_TIMEOUT +
+
+
POP3::$POP3_TIMEOUT in class.pop3.php
+
Default Timeout
+
+
+ $Port +
+
+
PHPMailer::$Port in class.phpmailer.php
+
Sets the default SMTP server port.
+
+
+ $port +
+
+
POP3::$port in class.pop3.php
+
POP3 Port
+
+
+ $Priority +
+
+
PHPMailer::$Priority in class.phpmailer.php
+
Email priority (1 = High, 3 = Normal, 5 = low).
+
+
+ PHPMailer +
+
+
PHPMailer in class.phpmailer.php
+
+
+ POP3 +
+
+
POP3::POP3() in class.pop3.php
+
Constructor, sets the initial values
+
+
+ POP3 +
+
+
POP3 in class.pop3.php
+
+
+ +
+
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
+ +
+
+
+
+ $ReplyTo +
+
+
PHPMailer::$ReplyTo in class.phpmailer.php
+
+
+ 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.
+
+
+ $sign_cert_file +
+
+
PHPMailer::$sign_cert_file in class.phpmailer.php
+
+
+ $sign_key_file +
+
+
PHPMailer::$sign_key_file in class.phpmailer.php
+
+
+ $sign_key_pass +
+
+
PHPMailer::$sign_key_pass in class.phpmailer.php
+
+
+ $SingleTo +
+
+
PHPMailer::$SingleTo in class.phpmailer.php
+
Provides the ability to have the TO field process individual
+
+
+ $smtp +
+
+
PHPMailer::$smtp in class.phpmailer.php
+
+
+ $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().
+
+
+ $SMTPSecure +
+
+
PHPMailer::$SMTPSecure in class.phpmailer.php
+
Sets connection prefix.
+
+
+ $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
+
+
+ sendString +
+
+
POP3::sendString() in class.pop3.php
+
Send a string down the open socket connection to the POP3 server
+
+
+ set +
+
+
PHPMailer::set() in class.phpmailer.php
+
Set (or reset) Class Objects (variables)
+
+
+ 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.
+
+
+ Sign +
+
+
PHPMailer::Sign() in class.phpmailer.php
+
Set the private key file and password to sign the message.
+
+
+ SMTP +
+
+
SMTP in class.smtp.php
+
+
+ SMTP +
+
+
SMTP::SMTP() in class.smtp.php
+
Initialize the class so that the data is in a known state.
+
+
+ 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.
+
+
+ $to +
+
+
PHPMailer::$to in class.phpmailer.php
+
+
+ $tval +
+
+
POP3::$tval in class.pop3.php
+
POP3 Timeout Value
+
+
+ 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 +
+
+
POP3::$username in class.pop3.php
+
POP3 Username
+
+
+ $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 + g + h + i + l + m + n + p + q + r + s + t + u + v + w +
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/elementindex_PHPMailer.html b/plugin/PHPMailer_v2.0.4/phpdocs/elementindex_PHPMailer.html new file mode 100644 index 000000000..7694cdec6 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/elementindex_PHPMailer.html @@ -0,0 +1,1046 @@ + + + + + + + + + + + +

[PHPMailer] element index

+All elements +
+
+ a + b + c + d + e + f + g + h + i + l + 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.
+
+
+ $attachment +
+
+
PHPMailer::$attachment in class.phpmailer.php
+
+
+ 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.
+
+
+ Authorise +
+
+
POP3::Authorise() in class.pop3.php
+
Combination of public events - connect, login, disconnect
+
+
+ +
+
b
+ +
+
+
+
+ $bcc +
+
+
PHPMailer::$bcc in class.phpmailer.php
+
+
+ $Body +
+
+
PHPMailer::$Body in class.phpmailer.php
+
Sets the Body of the message. This can be either an HTML or text body.
+
+
+ $boundary +
+
+
PHPMailer::$boundary in class.phpmailer.php
+
+
+ +
+
c
+ +
+
+
+
+ $cc +
+
+
PHPMailer::$cc in class.phpmailer.php
+
+
+ $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
+
+
+ $CRLF +
+
+
POP3::$CRLF in class.pop3.php
+
POP3 Carriage Return + Line Feed
+
+
+ $CustomHeader +
+
+
PHPMailer::$CustomHeader in class.phpmailer.php
+
+
+ catchWarning +
+
+
POP3::catchWarning() in class.pop3.php
+
Takes over from PHP for the socket warning handler
+
+
+ checkResponse +
+
+
POP3::checkResponse() in class.pop3.php
+
Checks the POP3 server response for +OK or -ERR
+
+
+ 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.
+
+
+ Connect +
+
+
POP3::Connect() in class.pop3.php
+
Connect to the POP3 server
+
+
+ class.phpmailer.php +
+
+
class.phpmailer.php in class.phpmailer.php
+
+
+ class.pop3.php +
+
+
class.pop3.php in class.pop3.php
+
+
+ class.smtp.php +
+
+
class.smtp.php in class.smtp.php
+
+
+ +
+
d
+ +
+
+
+
+ $do_debug +
+
+
SMTP::$do_debug in class.smtp.php
+
Sets whether debugging is turned on
+
+
+ $do_debug +
+
+
POP3::$do_debug in class.pop3.php
+
Displaying Debug warnings? (0 = now, 1+ = yes)
+
+
+ $do_verp +
+
+
SMTP::$do_verp in class.smtp.php
+
Sets VERP use on/off (default is off)
+
+
+ Data +
+
+
SMTP::Data() in class.smtp.php
+
Issues a data command and sends the msg_data to the server
+
+
+ Disconnect +
+
+
POP3::Disconnect() in class.pop3.php
+
Disconnect from the POP3 server
+
+
+ displayErrors +
+
+
POP3::displayErrors() in class.pop3.php
+
If debug is enabled, display the error message array
+
+
+ +
+
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.
+
+
+ $error_count +
+
+
PHPMailer::$error_count in class.phpmailer.php
+
+
+ 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.
+
+
+ +
+
g
+ +
+
+
+
+ getFile +
+
+
PHPMailer::getFile() in class.phpmailer.php
+
Read a file from a supplied filename and return it.
+
+
+ getResponse +
+
+
POP3::getResponse() in class.pop3.php
+
Get the socket response back.
+
+
+ +
+
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").
+
+
+ $host +
+
+
POP3::$host in class.pop3.php
+
POP3 Mail Server
+
+
+ $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'.
+
+
+ HeaderLine +
+
+
PHPMailer::HeaderLine() in class.phpmailer.php
+
+
+ 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.
+
+
+ +
+
l
+ +
+
+
+
+ $language +
+
+
PHPMailer::$language in class.phpmailer.php
+
+
+ $LE +
+
+
PHPMailer::$LE in class.phpmailer.php
+
+
+ Login +
+
+
POP3::Login() in class.pop3.php
+
Login to the POP3 server (does not support APOP yet)
+
+
+ +
+
m
+ +
+
+
+
+ $Mailer +
+
+
PHPMailer::$Mailer in class.phpmailer.php
+
Method to send mail: ("mail", "sendmail", or "smtp").
+
+
+ $MessageID +
+
+
PHPMailer::$MessageID in class.phpmailer.php
+
Sets the message ID to be used in the Message-Id header.
+
+
+ $message_type +
+
+
PHPMailer::$message_type in class.phpmailer.php
+
+
+ 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.
+
+
+ MsgHTML +
+
+
PHPMailer::MsgHTML() in class.phpmailer.php
+
Evaluates the message and returns modifications for inline images and backgrounds
+
+
+ +
+
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.
+
+
+ $password +
+
+
POP3::$password in class.pop3.php
+
POP3 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.
+
+
+ $POP3_PORT +
+
+
POP3::$POP3_PORT in class.pop3.php
+
Default POP3 port
+
+
+ $POP3_TIMEOUT +
+
+
POP3::$POP3_TIMEOUT in class.pop3.php
+
Default Timeout
+
+
+ $Port +
+
+
PHPMailer::$Port in class.phpmailer.php
+
Sets the default SMTP server port.
+
+
+ $port +
+
+
POP3::$port in class.pop3.php
+
POP3 Port
+
+
+ $Priority +
+
+
PHPMailer::$Priority in class.phpmailer.php
+
Email priority (1 = High, 3 = Normal, 5 = low).
+
+
+ PHPMailer +
+
+
PHPMailer in class.phpmailer.php
+
+
+ POP3 +
+
+
POP3::POP3() in class.pop3.php
+
Constructor, sets the initial values
+
+
+ POP3 +
+
+
POP3 in class.pop3.php
+
+
+ +
+
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
+ +
+
+
+
+ $ReplyTo +
+
+
PHPMailer::$ReplyTo in class.phpmailer.php
+
+
+ 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.
+
+
+ $sign_cert_file +
+
+
PHPMailer::$sign_cert_file in class.phpmailer.php
+
+
+ $sign_key_file +
+
+
PHPMailer::$sign_key_file in class.phpmailer.php
+
+
+ $sign_key_pass +
+
+
PHPMailer::$sign_key_pass in class.phpmailer.php
+
+
+ $SingleTo +
+
+
PHPMailer::$SingleTo in class.phpmailer.php
+
Provides the ability to have the TO field process individual
+
+
+ $smtp +
+
+
PHPMailer::$smtp in class.phpmailer.php
+
+
+ $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().
+
+
+ $SMTPSecure +
+
+
PHPMailer::$SMTPSecure in class.phpmailer.php
+
Sets connection prefix.
+
+
+ $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
+
+
+ sendString +
+
+
POP3::sendString() in class.pop3.php
+
Send a string down the open socket connection to the POP3 server
+
+
+ set +
+
+
PHPMailer::set() in class.phpmailer.php
+
Set (or reset) Class Objects (variables)
+
+
+ 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.
+
+
+ Sign +
+
+
PHPMailer::Sign() in class.phpmailer.php
+
Set the private key file and password to sign the message.
+
+
+ SMTP +
+
+
SMTP in class.smtp.php
+
+
+ SMTP +
+
+
SMTP::SMTP() in class.smtp.php
+
Initialize the class so that the data is in a known state.
+
+
+ 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.
+
+
+ $to +
+
+
PHPMailer::$to in class.phpmailer.php
+
+
+ $tval +
+
+
POP3::$tval in class.pop3.php
+
POP3 Timeout Value
+
+
+ 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 +
+
+
POP3::$username in class.pop3.php
+
POP3 Username
+
+
+ $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 + g + h + i + l + m + n + p + q + r + s + t + u + v + w +
+ \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/index.html b/plugin/PHPMailer_v2.0.4/phpdocs/index.html new file mode 100644 index 000000000..3d66c1e28 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/index.html @@ -0,0 +1,24 @@ + + + + + + PHPMailer version 2.0.4 + + + + + + + + + + + <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/plugin/PHPMailer_v2.0.4/phpdocs/li_PHPMailer.html b/plugin/PHPMailer_v2.0.4/phpdocs/li_PHPMailer.html new file mode 100644 index 000000000..e88a5803a --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/li_PHPMailer.html @@ -0,0 +1,38 @@ + + + + + + + + + + +
PHPMailer
+
+ +
+ +
Description
+
+ Class trees
+ Index of elements
+
+ + + +
Classes
+
PHPMailer
+
POP3
+
SMTP
+
Files
+
class.phpmailer.php
+
class.pop3.php
+
class.smtp.php
+ + +
+
+

phpDocumentor v 1.3.0RC3

+ + \ No newline at end of file diff --git a/plugin/PHPMailer_v2.0.4/phpdocs/media/banner.css b/plugin/PHPMailer_v2.0.4/phpdocs/media/banner.css new file mode 100644 index 000000000..f2149ebb4 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/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/plugin/PHPMailer_v2.0.4/phpdocs/media/stylesheet.css b/plugin/PHPMailer_v2.0.4/phpdocs/media/stylesheet.css new file mode 100644 index 000000000..94870fb5a --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/media/stylesheet.css @@ -0,0 +1,144 @@ +a { color: #336699; text-decoration: none; } +a:hover { color: #6699CC; text-decoration: underline; } +a:active { color: #6699CC; text-decoration: underline; } + +body { background : #FFFFFF; } +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; } +*[class="src-code"] { line-height : 0.5em } + +.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 } + +.tute-tag { color: #009999 } +.tute-attribute-name { color: #0000FF } +.tute-attribute-value { color: #0099FF } +.tute-entity { font-weight: bold; } +.tute-comment { font-style: italic } +.tute-inline-tag { color: #636311; font-weight: bold } + +/* 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; } +*[class="example"] { line-height : 0.5em } +.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } +*[class="listing"] { line-height : 0.5em } +.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/plugin/PHPMailer_v2.0.4/phpdocs/packages.html b/plugin/PHPMailer_v2.0.4/phpdocs/packages.html new file mode 100644 index 000000000..fdf40b0b8 --- /dev/null +++ b/plugin/PHPMailer_v2.0.4/phpdocs/packages.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file