ChangeLog
+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
- GNU LESSER GENERAL PUBLIC LICENSE\r
- Version 2.1, February 1999\r
-\r
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-[This is the first released version of the Lesser GPL. It also counts\r
- as the successor of the GNU Library Public License, version 2, hence\r
- the version number 2.1.]\r
-\r
- Preamble\r
-\r
- The licenses for most software are designed to take away your\r
-freedom to share and change it. By contrast, the GNU General Public\r
-Licenses are intended to guarantee your freedom to share and change\r
-free software--to make sure the software is free for all its users.\r
-\r
- This license, the Lesser General Public License, applies to some\r
-specially designated software packages--typically libraries--of the\r
-Free Software Foundation and other authors who decide to use it. You\r
-can use it too, but we suggest you first think carefully about whether\r
-this license or the ordinary General Public License is the better\r
-strategy to use in any particular case, based on the explanations below.\r
-\r
- When we speak of free software, we are referring to freedom of use,\r
-not price. Our General Public Licenses are designed to make sure that\r
-you have the freedom to distribute copies of free software (and charge\r
-for this service if you wish); that you receive source code or can get\r
-it if you want it; that you can change the software and use pieces of\r
-it in new free programs; and that you are informed that you can do\r
-these things.\r
-\r
- To protect your rights, we need to make restrictions that forbid\r
-distributors to deny you these rights or to ask you to surrender these\r
-rights. These restrictions translate to certain responsibilities for\r
-you if you distribute copies of the library or if you modify it.\r
-\r
- For example, if you distribute copies of the library, whether gratis\r
-or for a fee, you must give the recipients all the rights that we gave\r
-you. You must make sure that they, too, receive or can get the source\r
-code. If you link other code with the library, you must provide\r
-complete object files to the recipients, so that they can relink them\r
-with the library after making changes to the library and recompiling\r
-it. And you must show them these terms so they know their rights.\r
-\r
- We protect your rights with a two-step method: (1) we copyright the\r
-library, and (2) we offer you this license, which gives you legal\r
-permission to copy, distribute and/or modify the library.\r
-\r
- To protect each distributor, we want to make it very clear that\r
-there is no warranty for the free library. Also, if the library is\r
-modified by someone else and passed on, the recipients should know\r
-that what they have is not the original version, so that the original\r
-author's reputation will not be affected by problems that might be\r
-introduced by others.\r
-\r
- Finally, software patents pose a constant threat to the existence of\r
-any free program. We wish to make sure that a company cannot\r
-effectively restrict the users of a free program by obtaining a\r
-restrictive license from a patent holder. Therefore, we insist that\r
-any patent license obtained for a version of the library must be\r
-consistent with the full freedom of use specified in this license.\r
-\r
- Most GNU software, including some libraries, is covered by the\r
-ordinary GNU General Public License. This license, the GNU Lesser\r
-General Public License, applies to certain designated libraries, and\r
-is quite different from the ordinary General Public License. We use\r
-this license for certain libraries in order to permit linking those\r
-libraries into non-free programs.\r
-\r
- When a program is linked with a library, whether statically or using\r
-a shared library, the combination of the two is legally speaking a\r
-combined work, a derivative of the original library. The ordinary\r
-General Public License therefore permits such linking only if the\r
-entire combination fits its criteria of freedom. The Lesser General\r
-Public License permits more lax criteria for linking other code with\r
-the library.\r
-\r
- We call this license the "Lesser" General Public License because it\r
-does Less to protect the user's freedom than the ordinary General\r
-Public License. It also provides other free software developers Less\r
-of an advantage over competing non-free programs. These disadvantages\r
-are the reason we use the ordinary General Public License for many\r
-libraries. However, the Lesser license provides advantages in certain\r
-special circumstances.\r
-\r
- For example, on rare occasions, there may be a special need to\r
-encourage the widest possible use of a certain library, so that it becomes\r
-a de-facto standard. To achieve this, non-free programs must be\r
-allowed to use the library. A more frequent case is that a free\r
-library does the same job as widely used non-free libraries. In this\r
-case, there is little to gain by limiting the free library to free\r
-software only, so we use the Lesser General Public License.\r
-\r
- In other cases, permission to use a particular library in non-free\r
-programs enables a greater number of people to use a large body of\r
-free software. For example, permission to use the GNU C Library in\r
-non-free programs enables many more people to use the whole GNU\r
-operating system, as well as its variant, the GNU/Linux operating\r
-system.\r
-\r
- Although the Lesser General Public License is Less protective of the\r
-users' freedom, it does ensure that the user of a program that is\r
-linked with the Library has the freedom and the wherewithal to run\r
-that program using a modified version of the Library.\r
-\r
- The precise terms and conditions for copying, distribution and\r
-modification follow. Pay close attention to the difference between a\r
-"work based on the library" and a "work that uses the library". The\r
-former contains code derived from the library, whereas the latter must\r
-be combined with the library in order to run.\r
-\r
- GNU LESSER GENERAL PUBLIC LICENSE\r
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
- 0. This License Agreement applies to any software library or other\r
-program which contains a notice placed by the copyright holder or\r
-other authorized party saying it may be distributed under the terms of\r
-this Lesser General Public License (also called "this License").\r
-Each licensee is addressed as "you".\r
-\r
- A "library" means a collection of software functions and/or data\r
-prepared so as to be conveniently linked with application programs\r
-(which use some of those functions and data) to form executables.\r
-\r
- The "Library", below, refers to any such software library or work\r
-which has been distributed under these terms. A "work based on the\r
-Library" means either the Library or any derivative work under\r
-copyright law: that is to say, a work containing the Library or a\r
-portion of it, either verbatim or with modifications and/or translated\r
-straightforwardly into another language. (Hereinafter, translation is\r
-included without limitation in the term "modification".)\r
-\r
- "Source code" for a work means the preferred form of the work for\r
-making modifications to it. For a library, complete source code means\r
-all the source code for all modules it contains, plus any associated\r
-interface definition files, plus the scripts used to control compilation\r
-and installation of the library.\r
-\r
- Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope. The act of\r
-running a program using the Library is not restricted, and output from\r
-such a program is covered only if its contents constitute a work based\r
-on the Library (independent of the use of the Library in a tool for\r
-writing it). Whether that is true depends on what the Library does\r
-and what the program that uses the Library does.\r
- \r
- 1. You may copy and distribute verbatim copies of the Library's\r
-complete source code as you receive it, in any medium, provided that\r
-you conspicuously and appropriately publish on each copy an\r
-appropriate copyright notice and disclaimer of warranty; keep intact\r
-all the notices that refer to this License and to the absence of any\r
-warranty; and distribute a copy of this License along with the\r
-Library.\r
-\r
- You may charge a fee for the physical act of transferring a copy,\r
-and you may at your option offer warranty protection in exchange for a\r
-fee.\r
-\r
- 2. You may modify your copy or copies of the Library or any portion\r
-of it, thus forming a work based on the Library, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
- a) The modified work must itself be a software library.\r
-\r
- b) You must cause the files modified to carry prominent notices\r
- stating that you changed the files and the date of any change.\r
-\r
- c) You must cause the whole of the work to be licensed at no\r
- charge to all third parties under the terms of this License.\r
-\r
- d) If a facility in the modified Library refers to a function or a\r
- table of data to be supplied by an application program that uses\r
- the facility, other than as an argument passed when the facility\r
- is invoked, then you must make a good faith effort to ensure that,\r
- in the event an application does not supply such function or\r
- table, the facility still operates, and performs whatever part of\r
- its purpose remains meaningful.\r
-\r
- (For example, a function in a library to compute square roots has\r
- a purpose that is entirely well-defined independent of the\r
- application. Therefore, Subsection 2d requires that any\r
- application-supplied function or table used by this function must\r
- be optional: if the application does not supply it, the square\r
- root function must still compute square roots.)\r
-\r
-These requirements apply to the modified work as a whole. If\r
-identifiable sections of that work are not derived from the Library,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works. But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Library, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote\r
-it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Library.\r
-\r
-In addition, mere aggregation of another work not based on the Library\r
-with the Library (or with a work based on the Library) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
- 3. You may opt to apply the terms of the ordinary GNU General Public\r
-License instead of this License to a given copy of the Library. To do\r
-this, you must alter all the notices that refer to this License, so\r
-that they refer to the ordinary GNU General Public License, version 2,\r
-instead of to this License. (If a newer version than version 2 of the\r
-ordinary GNU General Public License has appeared, then you can specify\r
-that version instead if you wish.) Do not make any other change in\r
-these notices.\r
-\r
- Once this change is made in a given copy, it is irreversible for\r
-that copy, so the ordinary GNU General Public License applies to all\r
-subsequent copies and derivative works made from that copy.\r
-\r
- This option is useful when you wish to copy part of the code of\r
-the Library into a program that is not a library.\r
-\r
- 4. You may copy and distribute the Library (or a portion or\r
-derivative of it, under Section 2) in object code or executable form\r
-under the terms of Sections 1 and 2 above provided that you accompany\r
-it with the complete corresponding machine-readable source code, which\r
-must be distributed under the terms of Sections 1 and 2 above on a\r
-medium customarily used for software interchange.\r
-\r
- If distribution of object code is made by offering access to copy\r
-from a designated place, then offering equivalent access to copy the\r
-source code from the same place satisfies the requirement to\r
-distribute the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
- 5. A program that contains no derivative of any portion of the\r
-Library, but is designed to work with the Library by being compiled or\r
-linked with it, is called a "work that uses the Library". Such a\r
-work, in isolation, is not a derivative work of the Library, and\r
-therefore falls outside the scope of this License.\r
-\r
- However, linking a "work that uses the Library" with the Library\r
-creates an executable that is a derivative of the Library (because it\r
-contains portions of the Library), rather than a "work that uses the\r
-library". The executable is therefore covered by this License.\r
-Section 6 states terms for distribution of such executables.\r
-\r
- When a "work that uses the Library" uses material from a header file\r
-that is part of the Library, the object code for the work may be a\r
-derivative work of the Library even though the source code is not.\r
-Whether this is true is especially significant if the work can be\r
-linked without the Library, or if the work is itself a library. The\r
-threshold for this to be true is not precisely defined by law.\r
-\r
- If such an object file uses only numerical parameters, data\r
-structure layouts and accessors, and small macros and small inline\r
-functions (ten lines or less in length), then the use of the object\r
-file is unrestricted, regardless of whether it is legally a derivative\r
-work. (Executables containing this object code plus portions of the\r
-Library will still fall under Section 6.)\r
-\r
- Otherwise, if the work is a derivative of the Library, you may\r
-distribute the object code for the work under the terms of Section 6.\r
-Any executables containing that work also fall under Section 6,\r
-whether or not they are linked directly with the Library itself.\r
-\r
- 6. As an exception to the Sections above, you may also combine or\r
-link a "work that uses the Library" with the Library to produce a\r
-work containing portions of the Library, and distribute that work\r
-under terms of your choice, provided that the terms permit\r
-modification of the work for the customer's own use and reverse\r
-engineering for debugging such modifications.\r
-\r
- You must give prominent notice with each copy of the work that the\r
-Library is used in it and that the Library and its use are covered by\r
-this License. You must supply a copy of this License. If the work\r
-during execution displays copyright notices, you must include the\r
-copyright notice for the Library among them, as well as a reference\r
-directing the user to the copy of this License. Also, you must do one\r
-of these things:\r
-\r
- a) Accompany the work with the complete corresponding\r
- machine-readable source code for the Library including whatever\r
- changes were used in the work (which must be distributed under\r
- Sections 1 and 2 above); and, if the work is an executable linked\r
- with the Library, with the complete machine-readable "work that\r
- uses the Library", as object code and/or source code, so that the\r
- user can modify the Library and then relink to produce a modified\r
- executable containing the modified Library. (It is understood\r
- that the user who changes the contents of definitions files in the\r
- Library will not necessarily be able to recompile the application\r
- to use the modified definitions.)\r
-\r
- b) Use a suitable shared library mechanism for linking with the\r
- Library. A suitable mechanism is one that (1) uses at run time a\r
- copy of the library already present on the user's computer system,\r
- rather than copying library functions into the executable, and (2)\r
- will operate properly with a modified version of the library, if\r
- the user installs one, as long as the modified version is\r
- interface-compatible with the version that the work was made with.\r
-\r
- c) Accompany the work with a written offer, valid for at\r
- least three years, to give the same user the materials\r
- specified in Subsection 6a, above, for a charge no more\r
- than the cost of performing this distribution.\r
-\r
- d) If distribution of the work is made by offering access to copy\r
- from a designated place, offer equivalent access to copy the above\r
- specified materials from the same place.\r
-\r
- e) Verify that the user has already received a copy of these\r
- materials or that you have already sent this user a copy.\r
-\r
- For an executable, the required form of the "work that uses the\r
-Library" must include any data and utility programs needed for\r
-reproducing the executable from it. However, as a special exception,\r
-the materials to be distributed need not include anything that is\r
-normally distributed (in either source or binary form) with the major\r
-components (compiler, kernel, and so on) of the operating system on\r
-which the executable runs, unless that component itself accompanies\r
-the executable.\r
-\r
- It may happen that this requirement contradicts the license\r
-restrictions of other proprietary libraries that do not normally\r
-accompany the operating system. Such a contradiction means you cannot\r
-use both them and the Library together in an executable that you\r
-distribute.\r
-\r
- 7. You may place library facilities that are a work based on the\r
-Library side-by-side in a single library together with other library\r
-facilities not covered by this License, and distribute such a combined\r
-library, provided that the separate distribution of the work based on\r
-the Library and of the other library facilities is otherwise\r
-permitted, and provided that you do these two things:\r
-\r
- a) Accompany the combined library with a copy of the same work\r
- based on the Library, uncombined with any other library\r
- facilities. This must be distributed under the terms of the\r
- Sections above.\r
-\r
- b) Give prominent notice with the combined library of the fact\r
- that part of it is a work based on the Library, and explaining\r
- where to find the accompanying uncombined form of the same work.\r
-\r
- 8. You may not copy, modify, sublicense, link with, or distribute\r
-the Library except as expressly provided under this License. Any\r
-attempt otherwise to copy, modify, sublicense, link with, or\r
-distribute the Library is void, and will automatically terminate your\r
-rights under this License. However, parties who have received copies,\r
-or rights, from you under this License will not have their licenses\r
-terminated so long as such parties remain in full compliance.\r
-\r
- 9. You are not required to accept this License, since you have not\r
-signed it. However, nothing else grants you permission to modify or\r
-distribute the Library or its derivative works. These actions are\r
-prohibited by law if you do not accept this License. Therefore, by\r
-modifying or distributing the Library (or any work based on the\r
-Library), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Library or works based on it.\r
-\r
- 10. Each time you redistribute the Library (or any work based on the\r
-Library), the recipient automatically receives a license from the\r
-original licensor to copy, distribute, link with or modify the Library\r
-subject to these terms and conditions. You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties with\r
-this License.\r
-\r
- 11. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License. If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Library at all. For example, if a patent\r
-license would not permit royalty-free redistribution of the Library by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Library.\r
-\r
-If any portion of this section is held invalid or unenforceable under any\r
-particular circumstance, the balance of the section is intended to apply,\r
-and the section as a whole is intended to apply in other circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system which is\r
-implemented by public license practices. Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
- 12. If the distribution and/or use of the Library is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Library under this License may add\r
-an explicit geographical distribution limitation excluding those countries,\r
-so that distribution is permitted only in or among countries not thus\r
-excluded. In such case, this License incorporates the limitation as if\r
-written in the body of this License.\r
-\r
- 13. The Free Software Foundation may publish revised and/or new\r
-versions of the Lesser General Public License from time to time.\r
-Such new versions will be similar in spirit to the present version,\r
-but may differ in detail to address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number. If the Library\r
-specifies a version number of this License which applies to it and\r
-"any later version", you have the option of following the terms and\r
-conditions either of that version or of any later version published by\r
-the Free Software Foundation. If the Library does not specify a\r
-license version number, you may choose any version ever published by\r
-the Free Software Foundation.\r
-\r
- 14. If you wish to incorporate parts of the Library into other free\r
-programs whose distribution conditions are incompatible with these,\r
-write to the author to ask for permission. For software which is\r
-copyrighted by the Free Software Foundation, write to the Free\r
-Software Foundation; we sometimes make exceptions for this. Our\r
-decision will be guided by the two goals of preserving the free status\r
-of all derivatives of our free software and of promoting the sharing\r
-and reuse of software generally.\r
-\r
- NO WARRANTY\r
-\r
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
-DAMAGES.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- How to Apply These Terms to Your New Libraries\r
-\r
- If you develop a new library, and you want it to be of the greatest\r
-possible use to the public, we recommend making it free software that\r
-everyone can redistribute and change. You can do so by permitting\r
-redistribution under these terms (or, alternatively, under the terms of the\r
-ordinary General Public License).\r
-\r
- To apply these terms, attach the following notices to the library. It is\r
-safest to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least the\r
-"copyright" line and a pointer to where the full notice is found.\r
-\r
- <one line to give the library's name and a brief idea of what it does.>\r
- Copyright (C) <year> <name of author>\r
-\r
- This library is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU Lesser General Public\r
- License as published by the Free Software Foundation; either\r
- version 2.1 of the License, or (at your option) any later version.\r
-\r
- This library is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- Lesser General Public License for more details.\r
-\r
- You should have received a copy of the GNU Lesser General Public\r
- License along with this library; if not, write to the Free Software\r
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the library, if\r
-necessary. Here is a sample; alter the names:\r
-\r
- Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
-\r
- <signature of Ty Coon>, 1 April 1990\r
- Ty Coon, President of Vice\r
-\r
-That's all there is to it!\r
-\r
-\r
+ 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.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
////////////////////////////////////////////////////
// phpmailer - PHP email class
//
-// Version 1.50, Created 11/08/2001
+// Version 1.60, Created 03/30/2002
//
// Class for sending email using either
// sendmail, PHP mail(), or SMTP. Methods are
* @public
* @type string
*/
- var $ErrorInfo = "";
+ var $ErrorInfo = "";
/**
* Sets the From email address for the message. Default value is "root@localhost".
* @public
* @type string
*/
- var $FromName = "Root User";
+ var $FromName = "Root User";
/**
* Sets the Sender email of the message. If not empty, will be sent via -f to sendmail
var $AltBody = "";
/**
- * Sets word wrapping on the message. Default value is 0 (off).
+ * Sets word wrapping on the body of the message to a given number of
+ * characters. Default value is 0 (off).
* @public
* @type int
*/
* @type bool
*/
var $UseMSMailHeaders = false;
+
+ /**
+ * Path to phpmailer plugins. This is now only useful if the SMTP class
+ * is in a different directory than the PHP include path.
+ * Default is empty ("").
+ * @public
+ * @type string
+ */
+ var $PluginDir = "";
/**
* Holds phpmailer version.
* @public
* @type string
*/
- var $Version = "1.50";
+ var $Version = "1.54";
+
+ /**
+ * Sets the email address that a reading confirmation will be sent. Default value is "".
+ * @public
+ * @type string
+ */
+ var $ConfirmReadingTo = "";
+
+ /**
+ * Sets the line endings of the message. Default is "\n";
+ * @public
+ * @type string
+ */
+ var $LE = "\n";
/////////////////////////////////////////////////
var $Password = "";
/**
- * Sets the SMTP server timeout in seconds. Does not function at this time
- * because PHP for win32 does not support it. Default value is 10.
+ * Sets the SMTP server timeout in seconds. This function will not
+ * work with the win32 version. Default value is 10.
* @public
* @type int
*/
var $CustomHeader = array();
/**
- * Holds the message boundary. Default is false.
+ * Holds the type of the message.
* @type string
*/
- var $boundary = false;
+ var $message_type = "";
/**
- * Holds the message boundary. This is used specifically
- * when multipart/alternative messages are sent. Default is false.
- * @type string
+ * Holds the message boundaries.
+ * @type string array
*/
- var $subboundary = false;
-
+ var $boundary = array();
/////////////////////////////////////////////////
// VARIABLE METHODS
* @returns bool
*/
function Send() {
- if(count($this->to) < 1)
+ $header = "";
+ $body = "";
+
+ if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
{
$this->error_handler("You must provide at least one recipient email address");
return false;
if(!empty($this->AltBody))
$this->ContentType = "multipart/alternative";
- $header = $this->create_header();
+ // Attach sender information & date
+ $header = $this->received();
+ $header .= sprintf("Date: %s%s", $this->rfc_date(), $this->LE);
+ $header .= $this->create_header();
+
if(!$body = $this->create_body())
return false;
return true;
}
+
+ /**
+ * Sends mail message to an assigned queue directory. Has an optional
+ * sendTime argument. This is used when the user wants the
+ * message to be sent from the queue at a predetermined time.
+ * The data must be a valid timestamp like that returned from
+ * the time() or strtotime() functions. Returns false on failure
+ * or the message file name if success.
+ * @public
+ * @returns string
+ */
+ function SendToQueue($queue_path, $send_time = 0) {
+ $message = array();
+ $header = "";
+ $body = "";
+
+ // If invalid or empty just set to the current time
+ if($send_time == 0)
+ $send_time = time();
+
+ if(!is_dir($queue_path))
+ {
+ $this->error_handler("The supplied queue directory does not exist");
+ return false;
+ }
+
+ if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
+ {
+ $this->error_handler("You must provide at least one recipient email address");
+ return false;
+ }
+
+ // Set whether the message is multipart/alternative
+ if(!empty($this->AltBody))
+ $this->ContentType = "multipart/alternative";
+
+ $header = $this->create_header();
+ if(!$body = $this->create_body())
+ return false;
+
+ // Seed randomizer
+ mt_srand(time());
+ $msg_id = md5(uniqid(mt_rand()));
+
+ $fp = fopen($queue_path . $msg_id . ".pqm", "wb");
+ if(!$fp)
+ {
+ $this->error_handler(sprintf("Could not write to %s directory", $queue_path));
+ return false;
+ }
+
+ $message[] = sprintf("----START PQM HEADER----%s", $this->LE);
+ $message[] = sprintf("SendTime: %s%s", $send_time, $this->LE);
+ $message[] = sprintf("Mailer: %s%s", $this->Mailer, $this->LE);
+
+ // Choose the mailer
+ if($this->Mailer == "sendmail")
+ {
+ $message[] = sprintf("Sendmail: %s%s", $this->Sendmail, $this->LE);
+ $message[] = sprintf("Sender: %s%s", $this->Sender, $this->LE);
+ }
+ elseif($this->Mailer == "mail")
+ {
+ $message[] = sprintf("Sender: %s%s", $this->Sender, $this->LE);
+ $message[] = sprintf("Subject: %s%s", $this->Subject, $this->LE);
+ $message[] = sprintf("to: %s%s", $this->addr_list($this->to), $this->LE);
+ }
+ elseif($this->Mailer == "smtp")
+ {
+ $message[] = sprintf("Host: %s%s", $this->Host, $this->LE);
+ $message[] = sprintf("Port: %d%s", $this->Port, $this->LE);
+ $message[] = sprintf("Helo: %s%s", $this->Helo, $this->LE);
+ $message[] = sprintf("Timeout: %d%s", $this->Timeout, $this->LE);
+
+ if($this->SMTPAuth)
+ $auth_no = 1;
+ else
+ $auth_no = 0;
+ $message[] = sprintf("SMTPAuth: %d%s", $auth_no, $this->LE);
+ $message[] = sprintf("Username: %s%s", $this->Username, $this->LE);
+ $message[] = sprintf("Password: %s%s", $this->Password, $this->LE);
+ $message[] = sprintf("From: %s%s", $this->From, $this->LE);
+
+ $message[] = sprintf("to: %s%s", $this->addr_list($this->to), $this->LE);
+ $message[] = sprintf("cc: %s%s", $this->addr_list($this->cc), $this->LE);
+ $message[] = sprintf("bcc: %s%s", $this->addr_list($this->bcc), $this->LE);
+ }
+ else
+ {
+ $this->error_handler(sprintf("%s mailer is not supported", $this->Mailer));
+ return false;
+ }
+
+ $message[] = sprintf("----END PQM HEADER----%s", $this->LE); // end of pqm header
+ $message[] = $header;
+ $message[] = $body;
+
+ fwrite($fp, join("", $message));
+
+ return ($msg_id . ".pqm");
+ }
/**
* Sends mail using the $Sendmail program. Returns bool.
fputs($mail, $header);
fputs($mail, $body);
- pclose($mail);
+
+ $result = pclose($mail) >> 8 & 0xFF;
+ if($result != 0)
+ {
+ $this->error_handler(sprintf("Could not execute %s", $this->Sendmail));
+ return false;
+ }
return true;
}
*/
function smtp_send($header, $body) {
// Include SMTP class code, but not twice
- include_once("class.smtp.php"); // Load code only if asked
+ include_once($this->PluginDir . "class.smtp.php");
$smtp = new SMTP;
* @returns string
*/
function addr_append($type, $addr) {
- $addr_str = "";
- $addr_str .= sprintf("%s: \"%s\" <%s>", $type, addslashes($addr[0][1]), $addr[0][0]);
+ $addr_str = $type . ": ";
+ $addr_str .= $this->addr_format($addr[0]);
if(count($addr) > 1)
{
for($i = 1; $i < count($addr); $i++)
{
- $addr_str .= sprintf(", \"%s\" <%s>", addslashes($addr[$i][1]), $addr[$i][0]);
+ $addr_str .= sprintf(", %s", $this->addr_format($addr[$i]));
}
- $addr_str .= "\r\n";
+ $addr_str .= $this->LE;
}
else
- $addr_str .= "\r\n";
+ $addr_str .= $this->LE;
return($addr_str);
}
+
+ /**
+ * Creates a semicolon delimited list for use in pqm files.
+ * @private
+ * @returns string
+ */
+ function addr_list($list_array) {
+ $addr_list = "";
+ for($i = 0; $i < count($list_array); $i++)
+ {
+ if($i > 0)
+ $addr_list .= ";";
+ $addr_list .= $list_array[$i][0];
+ }
+
+ return $addr_list;
+ }
+
+ /**
+ * Formats an address correctly.
+ * @private
+ * @returns string
+ */
+ function addr_format($addr) {
+ if(empty($addr[1]))
+ $formatted = $addr[0];
+ else
+ $formatted = sprintf('"%s" <%s>', addslashes($addr[1]), $addr[0]);
+
+ return $formatted;
+ }
/**
* Wraps message for use with mailers that do not
* @private
* @returns string
*/
- function wordwrap($message, $length, $qp_mode = false) {
+ function word_wrap($message, $length, $qp_mode = false) {
if ($qp_mode)
- $soft_break = " =\r\n";
+ $soft_break = sprintf(" =%s", $this->LE);
else
- $soft_break = "\r\n";
+ $soft_break = $this->LE;
$message = $this->fix_eol($message);
- if (substr($message, -1) == "\r\n")
+ if (substr($message, -1) == $this->LE)
$message = substr($message, 0, -1);
- $line = explode("\r\n", $message);
+ $line = explode($this->LE, $message);
$message = "";
for ($i=0 ;$i < count($line); $i++)
{
$part = substr($word, 0, $len);
$word = substr($word, $len);
$buf .= " " . $part;
- $message .= $buf . "=\r\n";
+ $message .= $buf . sprintf("=%s", $this->LE);
}
else
{
$word = substr($word, $len);
if (strlen($word) > 0)
- $message .= $part . "=\r\n";
+ $message .= $part . sprintf("=%s", $this->LE);
else
$buf = $part;
}
}
}
}
- $message .= $buf . "\r\n";
+ $message .= $buf . $this->LE;
}
return ($message);
*/
function create_header() {
$header = array();
- $header[] = $this->received();
- $header[] = sprintf("Date: %s\r\n", $this->rfc_date());
+
+ // Set the boundaries
+ $uniq_id = md5(uniqid(time()));
+ $this->boundary[1] = "b1_" . $uniq_id;
+ $this->boundary[2] = "b2_" . $uniq_id;
// To be created automatically by mail()
- if($this->Mailer != "mail")
+ if(($this->Mailer != "mail") && (count($this->to) > 0))
$header[] = $this->addr_append("To", $this->to);
- $header[] = sprintf("From: \"%s\" <%s>\r\n", addslashes($this->FromName), trim($this->From));
+ $header[] = sprintf("From: \"%s\" <%s>%s", addslashes($this->FromName),
+ trim($this->From), $this->LE);
if(count($this->cc) > 0)
$header[] = $this->addr_append("Cc", $this->cc);
// mail() sets the subject itself
if($this->Mailer != "mail")
- $header[] = sprintf("Subject: %s\r\n", trim($this->Subject));
+ $header[] = sprintf("Subject: %s%s", trim($this->Subject), $this->LE);
- $header[] = sprintf("X-Priority: %d\r\n", $this->Priority);
- $header[] = sprintf("X-Mailer: Moodle phpmailer [version %s]\r\n", $this->Version);
- $header[] = sprintf("Return-Path: %s\r\n", trim($this->From));
+ $header[] = sprintf("X-Priority: %d%s", $this->Priority, $this->LE);
+ $header[] = sprintf("X-Mailer: phpmailer [version %s]%s", $this->Version, $this->LE);
+ $header[] = sprintf("Return-Path: %s%s", trim($this->From), $this->LE);
+
+ if($this->ConfirmReadingTo != "")
+ $header[] = sprintf("Disposition-Notification-To: <%s>%s",
+ trim($this->ConfirmReadingTo), $this->LE);
// Add custom headers
for($index = 0; $index < count($this->CustomHeader); $index++)
- $header[] = sprintf("%s\r\n", $this->CustomHeader[$index]);
+ $header[] = sprintf("%s%s", $this->CustomHeader[$index], $this->LE);
if($this->UseMSMailHeaders)
$header[] = $this->AddMSMailHeaders();
- $header[] = "MIME-Version: 1.0\r\n";
+ $header[] = sprintf("MIME-Version: 1.0%s", $this->LE);
- // Add all attachments
- if(count($this->attachment) > 0 || !empty($this->AltBody))
+ // Determine what type of message this is
+ if(count($this->attachment) < 1 && strlen($this->AltBody) < 1)
+ $this->message_type = "plain";
+ else
{
- // Set message boundary
- $this->boundary = "_b" . md5(uniqid(time()));
- // Set message subboundary for multipart/alternative
- $this->subboundary = "_sb" . md5(uniqid(time()));
-
- $header[] = "Content-Type: Multipart/Mixed;\r\n";
- $header[] = sprintf("\tboundary=\"Boundary-=%s\"\r\n\r\n", $this->boundary);
+ 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";
}
- else
+
+ switch($this->message_type)
{
- $header[] = sprintf("Content-Transfer-Encoding: %s\r\n", $this->Encoding);
- $header[] = sprintf("Content-Type: %s; charset = \"%s\"",
- $this->ContentType, $this->CharSet);
- // No additional lines when using mail() function
- if($this->Mailer != "mail")
- $header[] = "\r\n\r\n";
+ case "plain":
+ $header[] = sprintf("Content-Transfer-Encoding: %s%s",
+ $this->Encoding, $this->LE);
+ $header[] = sprintf("Content-Type: %s; charset = \"%s\"",
+ $this->ContentType, $this->CharSet);
+ break;
+ case "attachments":
+ case "alt_attachments":
+ if($this->EmbeddedImageCount() > 0)
+ {
+ $header[] = sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s",
+ "multipart/related", $this->LE, $this->LE,
+ $this->boundary[1], $this->LE);
+ }
+ else
+ {
+ $header[] = sprintf("Content-Type: %s;%s",
+ "multipart/mixed", $this->LE);
+ $header[] = sprintf("\tboundary=\"%s\"%s", $this->boundary[1], $this->LE);
+ }
+ break;
+ case "alt":
+ $header[] = sprintf("Content-Type: %s;%s",
+ "multipart/alternative", $this->LE);
+ $header[] = sprintf("\tboundary=\"%s\"%s", $this->boundary[1], $this->LE);
+ break;
}
+ // No additional lines when using mail() function
+ if($this->Mailer != "mail")
+ $header[] = $this->LE.$this->LE;
+
return(join("", $header));
}
* @returns string
*/
function create_body() {
- // wordwrap the message body if set
- if($this->WordWrap)
- $this->Body = $this->wordwrap($this->Body, $this->WordWrap);
-
- // If content type is multipart/alternative set body like this:
- if ((!empty($this->AltBody)) && (count($this->attachment) < 1))
- {
- // Return text of body
- $mime = array();
- $mime[] = "This is a MIME message. If you are reading this text, you\r\n";
- $mime[] = "might want to consider changing to a mail reader that\r\n";
- $mime[] = "understands how to properly display MIME multipart messages.\r\n\r\n";
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->boundary);
-
- // Insert body. If multipart/alternative, insert both html and plain
- $mime[] = sprintf("Content-Type: %s; charset = \"%s\";\r\n" .
- "\tboundary=\"Boundary-=%s\";\r\n\r\n",
- $this->ContentType, $this->CharSet, $this->subboundary);
-
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
- $mime[] = sprintf("Content-Type: text/plain; charset = \"%s\";\r\n", $this->CharSet);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
- $mime[] = sprintf("%s\r\n\r\n", $this->AltBody);
-
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
- $mime[] = sprintf("Content-Type: text/html; charset = \"%s\";\r\n", $this->CharSet);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
- $mime[] = sprintf("%s\r\n\r\n", $this->Body);
-
- $mime[] = sprintf("\r\n--Boundary-=%s--\r\n\r\n", $this->subboundary);
-
- $mime[] = sprintf("\r\n--Boundary-=%s--\r\n", $this->boundary);
-
- $this->Body = $this->encode_string(join("", $mime), $this->Encoding);
- }
- else
- {
- $this->Body = $this->encode_string($this->Body, $this->Encoding);
- }
+ $body = array();
+ // wordwrap the message body if set
+ if($this->WordWrap > 0)
+ $this->Body = $this->word_wrap($this->Body, $this->WordWrap);
- if(count($this->attachment) > 0)
+ switch($this->message_type)
{
- if(!$body = $this->attach_all())
- return false;
+ case "alt":
+ // Return text of body
+ $bndry = new Boundary($this->boundary[1]);
+ $bndry->CharSet = $this->CharSet;
+ $bndry->Encoding = $this->Encoding;
+ $body[] = $bndry->GetSource();
+
+ $body[] = sprintf("%s%s", $this->AltBody, $this->LE.$this->LE);
+
+ $bndry = new Boundary($this->boundary[1]);
+ $bndry->CharSet = $this->CharSet;
+ $bndry->ContentType = "text/html";
+ $bndry->Encoding = $this->Encoding;
+ $body[] = $bndry->GetSource();
+
+ $body[] = sprintf("%s%s", $this->Body, $this->LE.$this->LE);
+
+ // End the boundary
+ $body[] = sprintf("%s--%s--%s", $this->LE,
+ $this->boundary[1], $this->LE.$this->LE);
+ break;
+ case "plain":
+ $body[] = $this->Body;
+ break;
+ case "attachments":
+ $bndry = new Boundary($this->boundary[1]);
+ $bndry->CharSet = $this->CharSet;
+ $bndry->ContentType = $this->ContentType;
+ $bndry->Encoding = $this->Encoding;
+ $body[] = sprintf("%s%s%s%s", $bndry->GetSource(false), $this->LE,
+ $this->Body, $this->LE);
+
+ if(!$body[] = $this->attach_all())
+ return false;
+ break;
+ case "alt_attachments":
+ $body[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
+ $body[] = sprintf("Content-Type: %s;%s" .
+ "\tboundary=\"%s\"%s",
+ "multipart/alternative", $this->LE,
+ $this->boundary[2], $this->LE.$this->LE);
+
+ // Create text body
+ $bndry = new Boundary($this->boundary[2]);
+ $bndry->CharSet = $this->CharSet;
+ $bndry->ContentType = "text/plain";
+ $bndry->Encoding = $this->Encoding;
+ $body[] = $bndry->GetSource() . $this->LE;
+
+ $body[] = sprintf("%s%s", $this->AltBody, $this->LE.$this->LE);
+
+ // Create the HTML body
+ $bndry = new Boundary($this->boundary[2]);
+ $bndry->CharSet = $this->CharSet;
+ $bndry->ContentType = "text/html";
+ $bndry->Encoding = $this->Encoding;
+ $body[] = $bndry->GetSource() . $this->LE;
+
+ $body[] = sprintf("%s%s", $this->Body, $this->LE.$this->LE);
+
+ $body[] = sprintf("%s--%s--%s", $this->LE,
+ $this->boundary[2], $this->LE.$this->LE);
+
+ if(!$body[] = $this->attach_all())
+ return false;
+ break;
}
- else
- $body = $this->Body;
+ // Add the encode string code here
+ $sBody = join("", $body);
+ $sBody = $this->encode_string($sBody, $this->Encoding);
- return($body);
+ return $sBody;
}
$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;
}
function attach_all() {
// Return text of body
$mime = array();
- $mime[] = "This is a MIME message. If you are reading this text, you\r\n";
- $mime[] = "might want to consider changing to a mail reader that\r\n";
- $mime[] = "understands how to properly display MIME multipart messages.\r\n\r\n";
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->boundary);
- // Insert body. If multipart/alternative, insert both html and plain.
- if (!empty($this->AltBody))
+ // Add all attachments
+ for($i = 0; $i < count($this->attachment); $i++)
{
- $mime[] = sprintf("Content-Type: %s; charset = \"%s\";\r\n" .
- "\tboundary=\"Boundary-=%s\";\r\n\r\n",
- $this->ContentType, $this->CharSet, $this->subboundary);
+ // Check for string attachment
+ $isString = $this->attachment[$i][5];
+ if ($isString)
+ {
+ $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, $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);
+ else
+ $mime[] = sprintf("Content-ID: <%s>%s", $name, $this->LE);
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
- $mime[] = sprintf("Content-Type: text/plain; charset = \"%s\";\r\n", $this->CharSet);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
- $mime[] = sprintf("%s\r\n\r\n", $this->AltBody);
+ $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s",
+ $disposition, $name, $this->LE.$this->LE);
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->subboundary);
- $mime[] = sprintf("Content-Type: text/html; charset = \"%s\";\r\n", $this->CharSet);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
- $mime[] = sprintf("%s\r\n\r\n", $this->Body);
+ // Encode as string attachment
+ if($isString)
+ {
+ if(!$mime[] = sprintf("%s%s", $this->encode_string($string, $encoding),
+ $this->LE.$this->LE))
+ return false;
+ }
+ else
+ {
+ if(!$mime[] = sprintf("%s%s", $this->encode_file($path, $encoding),
+ $this->LE.$this->LE))
+ return false;
- $mime[] = sprintf("\r\n--Boundary-=%s--\r\n\r\n", $this->subboundary);
- }
- else
- {
- $mime[] = sprintf("Content-Type: %s; charset = \"%s\";\r\n", $this->ContentType, $this->CharSet);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n\r\n", $this->Encoding);
- $mime[] = sprintf("%s\r\n", $this->Body);
- }
+ $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
- // Add all attachments
- for($i = 0; $i < count($this->attachment); $i++)
- {
- // Check for string attachment
- $isString = $this->attachment[$i][5];
- if ($isString)
- {
- $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];
- $mime[] = sprintf("--Boundary-=%s\r\n", $this->boundary);
- $mime[] = sprintf("Content-Type: %s; ", $type);
- $mime[] = sprintf("name=\"%s\"\r\n", $name);
- $mime[] = sprintf("Content-Transfer-Encoding: %s\r\n", $encoding);
- $mime[] = sprintf("Content-Disposition: attachment; filename=\"%s\"\r\n\r\n", $name);
-
- // Encode as string attachment
- if($isString)
- {
- if(!$mime[] = sprintf("%s\r\n\r\n", $this->encode_string($string, $encoding)))
- return false;
- }
- else
- {
- if(!$mime[] = sprintf("%s\r\n\r\n", $this->encode_file($path, $encoding)))
- return false;
- }
+ }
}
- $mime[] = sprintf("\r\n--Boundary-=%s--\r\n", $this->boundary);
return(join("", $mime));
}
-
+
/**
* Encodes attachment in requested format. Returns a
* string if successful or false if unsuccessful.
case "7bit":
case "8bit":
$encoded = $this->fix_eol($str);
- if (substr($encoded, -2) != "\r\n")
- $encoded .= "\r\n";
+ if (substr($encoded, -2) != $this->LE)
+ $encoded .= $this->LE;
break;
case "binary":
*/
function encode_qp ($str) {
$encoded = $this->fix_eol($str);
- if (substr($encoded, -2) != "\r\n")
- $encoded .= "\r\n";
+ if (substr($encoded, -2) != $this->LE)
+ $encoded .= $this->LE;
// Replace every high ascii, control and = characters
$encoded = preg_replace("/([\001-\010\013\014\016-\037\075\177-\377])/e",
"'='.sprintf('%02X', ord('\\1'))", $encoded);
// Replace every spaces and tabs when it's the last character on a line
- $encoded = preg_replace("/([\011\040])\r\n/e",
- "'='.sprintf('%02X', ord('\\1')).'\r\n'", $encoded);
+ $encoded = preg_replace("/([\011\040])".$this->LE."/e",
+ "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded);
// Maximum line length of 76 characters before CRLF (74 + space + '=')
- $encoded = $this->WordWrap($encoded, 74, true);
+ $encoded = $this->word_wrap($encoded, 74, true);
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.
- * @public
- * @returns void
- */
+ * 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.
+ * @public
+ * @returns void
+ */
function AddStringAttachment($string, $filename, $encoding = "base64", $type = "application/octet-stream") {
// Append to $attachment array
$cur = count($this->attachment);
$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.
+ * @param cid this is the Content Id of the attachment. Use this to identify
+ * the Id for accessing the image in an HTML form.
+ * @public
+ * @returns bool
+ */
+ function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", $type = "application/octet-stream") {
+
+ if(!@is_file($path))
+ {
+ $this->error_handler(sprintf("Could not access [%s] file", $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; // isStringAttachment
+ $this->attachment[$cur][6] = "inline";
+ $this->attachment[$cur][7] = $cid;
+
+ return true;
+ }
+
+ /**
+ * Returns the number of embedded images in an email.
+ * @private
+ * @returns int
+ */
+ function EmbeddedImageCount() {
+ $ret = 0;
+ for($i = 0; $i < count($this->attachment); $i++)
+ {
+ if($this->attachment[$i][6] == "inline")
+ $ret++;
+ }
+
+ return $ret;
}
/////////////////////////////////////////////////
* @returns string
*/
function received() {
- global $HTTP_SERVER_VARS;
- global $HTTP_ENV_VARS;
-
- // IIS & Apache use different global variables
- if($HTTP_SERVER_VARS["REMOTE_ADDR"] == "")
- $http_vars = $HTTP_ENV_VARS; // Apache found
- else
- $http_vars = $HTTP_SERVER_VARS; // IIS found
+ // Check for vars because they might not exist. Possibly
+ // write a small retrieval function (that mailer can use too!)
$str = sprintf("Received: from phpmailer ([%s]) by %s " .
- "with HTTP (%s);\r\n\t %s\r\n",
- $http_vars["REMOTE_ADDR"],
- $http_vars["SERVER_NAME"],
- $http_vars["SERVER_SOFTWARE"],
- $this->rfc_date());
+ "with HTTP;%s\t %s%s",
+ $this->get_server_var("REMOTE_ADDR"),
+ $this->get_server_var("SERVER_NAME"),
+ $this->LE,
+ $this->rfc_date(),
+ $this->LE);
return $str;
}
+
+ /**
+ * 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.
+ * @private
+ * @returns mixed
+ */
+ function get_server_var($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 "";
+ }
/**
* Changes every end of line from CR or LF to CRLF. Returns string.
function fix_eol($str) {
$str = str_replace("\r\n", "\n", $str);
$str = str_replace("\r", "\n", $str);
- $str = str_replace("\n", "\r\n", $str);
+ $str = str_replace("\n", $this->LE, $str);
return $str;
}
else
$MSPriority = "Medium";
- $MSHeader .= sprintf("X-MSMail-Priority: %s\r\n", $MSPriority);
- $MSHeader .= sprintf("Importance: %s\r\n", $MSPriority);
+ $MSHeader .= sprintf("X-MSMail-Priority: %s%s", $MSPriority, $this->LE);
+ $MSHeader .= sprintf("Importance: %s%s", $MSPriority, $this->LE);
return($MSHeader);
}
}
-// End of class
+
+
+/**
+ * Boundary - MIME message boundary class
+ * @author Brent R. Matzelle
+ */
+class Boundary
+{
+ /**
+ * Sets the boundary ID.
+ * @private
+ * @type string
+ */
+ var $ID = 0;
+
+ /**
+ * Sets the boundary Content Type.
+ * @public
+ * @type string
+ */
+ var $ContentType = "text/plain";
+
+ /**
+ * Sets the Encoding.
+ * @public
+ * @type string
+ */
+ var $Encoding = "";
+
+ /**
+ * Sets an attachment disposition.
+ * @public
+ * @type string
+ */
+ var $Disposition = "";
+
+ /**
+ * Sets an attachment file name.
+ * @public
+ * @type string
+ */
+ var $FileName = "";
+
+ /**
+ * Sets the Char set.
+ * @public
+ * @type string
+ */
+ var $CharSet = "";
+
+ /**
+ * Sets the line endings of the message. Default is "\n";
+ * @public
+ * @type string
+ */
+ var $LE = "\n";
+
+ /**
+ * Main constructor.
+ */
+ function Boundary($boundary_id) {
+ $this->ID = $boundary_id;
+ }
+
+ /**
+ * Returns the source of the boundary.
+ * @public
+ * @returns string
+ */
+ function GetSource($bLineEnding = true) {
+ $ret = array();
+ $mime[] = sprintf("--%s%s", $this->ID, $this->LE);
+ $mime[] = sprintf("Content-Type: %s; charset = \"%s\"%s",
+ $this->ContentType, $this->CharSet, $this->LE);
+ //$mime[] = sprintf("Content-Transfer-Encoding: %s%s", $this->Encoding,
+ // $this->LE);
+
+ if(strlen($this->Disposition) > 0)
+ {
+ $mime[] = sprintf("Content-Disposition: %s;");
+ if(strlen($this->FileName) > 0)
+ $mime[] = sprinf("filename=\"%s\"", $this->$this->FileName);
+ }
+
+ if($bLineEnding)
+ $mime[] = $this->LE;
+
+ return join("", $mime);
+ }
+}
+
?>
\r
# sometimes the SMTP server takes a little longer to respond\r
# so we will give it a longer timeout for the first read\r
- // Commented b/c of win32 warning messages\r
- //if(function_exists("socket_set_timeout"))\r
- // socket_set_timeout($this->smtp_conn, 1, 0);\r
+ // Windows still does not have support for this timeout function\r
+ if(substr(PHP_OS, 0, 3) != "WIN")\r
+ socket_set_timeout($this->smtp_conn, 1, 0);\r
\r
# get any announcement stuff\r
$announce = $this->get_lines();\r
\r
# now send the lines to the server\r
while(list(,$line_out) = @each($lines_out)) {\r
- if($line_out[0] == ".") {\r
- $line_out = "." . $line_out;\r
+ if(strlen($line_out) > 0)\r
+ {\r
+ if(substr($line_out, 0, 1) == ".") {\r
+ $line_out = "." . $line_out;\r
+ }\r
}\r
fputs($this->smtp_conn,$line_out . $this->CRLF);\r
}\r
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc on Sun Aug 12 18:19:10 EDT 2001 -->
+<!-- Generated by javadoc on Sat Mar 30 14:15:49 EST 2002 -->
<TITLE>
: Index
</TITLE>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
-<A HREF="#_$_">$</A> <A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_I_">I</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <HR>
+<A HREF="#_$_">$</A> <A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <HR>
<A NAME="_$_"><!-- --></A><H2>
<B>$</B></H2>
<DL>
<DT><A HREF="phpmailer.html#$AltBody"><B>$AltBody</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets a multipart/alternative message.
+<DD>Sets the text-only body of the message.
<DT><A HREF="phpmailer.html#$Body"><B>$Body</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the Body of the message.
<DT><A HREF="phpmailer.html#$CharSet"><B>$CharSet</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the CharSet of the message.
+<DT><A HREF="Boundary.html#$CharSet"><B>$CharSet</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets the Char set.
+<DT><A HREF="phpmailer.html#$ConfirmReadingTo"><B>$ConfirmReadingTo</B></A> -
+Variable in class <A HREF="phpmailer.html">phpmailer</A>
+<DD>Sets the email address that a reading confirmation will be sent.
<DT><A HREF="phpmailer.html#$ContentType"><B>$ContentType</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the Content-type of the message.
+<DT><A HREF="Boundary.html#$ContentType"><B>$ContentType</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets the boundary Content Type.
+<DT><A HREF="Boundary.html#$Disposition"><B>$Disposition</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets an attachment disposition.
<DT><A HREF="phpmailer.html#$Encoding"><B>$Encoding</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the Encoding of the message.
+<DT><A HREF="Boundary.html#$Encoding"><B>$Encoding</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets the Encoding.
<DT><A HREF="phpmailer.html#$ErrorInfo"><B>$ErrorInfo</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Holds the most recent mailer error message.
+<DT><A HREF="Boundary.html#$FileName"><B>$FileName</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets an attachment file name.
<DT><A HREF="phpmailer.html#$From"><B>$From</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets the From email of the message.
+<DD>Sets the From email address for the message.
<DT><A HREF="phpmailer.html#$FromName"><B>$FromName</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the From name of the message.
<DT><A HREF="phpmailer.html#$Helo"><B>$Helo</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets the CharSet of the message.
+<DD>Sets the SMTP HELO of the message.
<DT><A HREF="phpmailer.html#$Host"><B>$Host</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets the SMTP host.
+<DD>Sets the SMTP hosts.
+<DT><A HREF="phpmailer.html#$LE"><B>$LE</B></A> -
+Variable in class <A HREF="phpmailer.html">phpmailer</A>
+<DD>Sets the line endings of the message.
+<DT><A HREF="Boundary.html#$LE"><B>$LE</B></A> -
+Variable in class <A HREF="Boundary.html">Boundary</A>
+<DD>Sets the line endings of the message.
<DT><A HREF="phpmailer.html#$Mailer"><B>$Mailer</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Method to send mail: ("mail", "sendmail", or "smtp").
<DT><A HREF="phpmailer.html#$Password"><B>$Password</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets SMTP password.
+<DT><A HREF="phpmailer.html#$PluginDir"><B>$PluginDir</B></A> -
+Variable in class <A HREF="phpmailer.html">phpmailer</A>
+<DD>Path to phpmailer plugins.
<DT><A HREF="phpmailer.html#$Port"><B>$Port</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets the SMTP server port.
+<DD>Sets the default SMTP server port.
<DT><A HREF="phpmailer.html#$Priority"><B>$Priority</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Email priority (1 = High, 3 = Normal, 5 = low).
<DT><A HREF="phpmailer.html#$SMTPAuth"><B>$SMTPAuth</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets SMTP authentication.
-<DT><A HREF="phpmailer.html#$SMTPDebug"><B>$SMTPDebug</B></A> -
-Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets SMTP class debugging on or off.
<DT><A HREF="phpmailer.html#$Subject"><B>$Subject</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Sets the Subject of the message.
-<DT><A HREF="phpmailer.html#$Timeout"><B>$Timeout</B></A> -
-Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets the SMTP server timeout.
<DT><A HREF="phpmailer.html#$UseMSMailHeaders"><B>$UseMSMailHeaders</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Turns Microsoft mail client headers on and off.
<DD>Holds phpmailer version.
<DT><A HREF="phpmailer.html#$WordWrap"><B>$WordWrap</B></A> -
Variable in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets word wrapping on the message.
+<DD>Sets word wrapping on the body of the message to a given number of
+ characters.
</DL>
<HR>
<A NAME="_A_"><!-- --></A><H2>
<DL>
<DT><A HREF="phpmailer.html#AddAddress(var, var)"><B>AddAddress(var, var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Adds a "to" address.
+<DD>Adds a "To" address.
<DT><A HREF="phpmailer.html#AddAttachment(var, var, var, var)"><B>AddAttachment(var, var, var, var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Checks if attachment is valid and then adds
- the attachment to the list.
+<DD>Adds an attachment from a path on the filesystem.
<DT><A HREF="phpmailer.html#AddBCC(var, var)"><B>AddBCC(var, var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Adds a "Bcc" address.
<DT><A HREF="phpmailer.html#AddCustomHeader(var)"><B>AddCustomHeader(var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Adds a custom header.
+<DT><A HREF="phpmailer.html#AddEmbeddedImage(var, var, var, var, var)"><B>AddEmbeddedImage(var, var, var, var, var)</B></A> -
+Method in class <A HREF="phpmailer.html">phpmailer</A>
+<DD>Adds an embedded attachment.
<DT><A HREF="phpmailer.html#AddReplyTo(var, var)"><B>AddReplyTo(var, var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Adds a "Reply-to" address.
<DT><A HREF="phpmailer.html#AddStringAttachment(var, var, var, var)"><B>AddStringAttachment(var, var, var, var)</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Adds the string attachment to the list.
+<DD>Adds a string or binary attachment (non-filesystem) to the list.
+</DL>
+<HR>
+<A NAME="_B_"><!-- --></A><H2>
+<B>B</B></H2>
+<DL>
+<DT><A HREF="Boundary.html"><B>Boundary</B></A> - class <A HREF="Boundary.html">Boundary</A>.<DD>Boundary - MIME message boundary class<DT><A HREF="Boundary.html#Boundary(var)"><B>Boundary(var)</B></A> -
+Constructor for class <A HREF="Boundary.html">Boundary</A>
+<DD>Main constructor.
</DL>
<HR>
<A NAME="_C_"><!-- --></A><H2>
array.
<DT><A HREF="phpmailer.html#ClearAttachments()"><B>ClearAttachments()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Clears all previously set attachments.
+<DD>Clears all previously set filesystem, string, and binary
+ attachments.
<DT><A HREF="phpmailer.html#ClearBCCs()"><B>ClearBCCs()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Clears all recipients assigned in the BCC array.
<DD>Clears all recipients assigned in the ReplyTo array.
</DL>
<HR>
+<A NAME="_G_"><!-- --></A><H2>
+<B>G</B></H2>
+<DL>
+<DT><A HREF="Boundary.html#GetSource(var)"><B>GetSource(var)</B></A> -
+Method in class <A HREF="Boundary.html">Boundary</A>
+<DD>Returns the source of the boundary.
+</DL>
+<HR>
<A NAME="_I_"><!-- --></A><H2>
<B>I</B></H2>
<DL>
<DD>Sets message type to HTML.
<DT><A HREF="phpmailer.html#IsMail()"><B>IsMail()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets Mailer to use PHP mail() function.
+<DD>Sets Mailer to send message using PHP mail() function.
<DT><A HREF="phpmailer.html#IsQmail()"><B>IsQmail()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets Mailer to use qmail MTA.
+<DD>Sets Mailer to send message using the qmail MTA.
<DT><A HREF="phpmailer.html#IsSendmail()"><B>IsSendmail()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets Mailer to use $Sendmail program.
+<DD>Sets Mailer to send message using the $Sendmail program.
<DT><A HREF="phpmailer.html#IsSMTP()"><B>IsSMTP()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
-<DD>Sets Mailer to use SMTP.
+<DD>Sets Mailer to send message using SMTP.
</DL>
<HR>
<A NAME="_P_"><!-- --></A><H2>
<DT><A HREF="phpmailer.html#Send()"><B>Send()</B></A> -
Method in class <A HREF="phpmailer.html">phpmailer</A>
<DD>Creates message and assigns Mailer.
+<DT><A HREF="phpmailer.html#SendToQueue(var, var)"><B>SendToQueue(var, var)</B></A> -
+Method in class <A HREF="phpmailer.html">phpmailer</A>
+<DD>Sends mail message to an assigned queue directory.
</DL>
<HR>
-<A HREF="#_$_">$</A> <A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_I_">I</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A>
+<A HREF="#_$_">$</A> <A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">\r
-<!--NewPage-->\r
-<HTML>\r
-<HEAD>\r
-<!-- Generated by javadoc on Fri Nov 09 09:52:50 EST 2001 -->\r
-<TITLE>\r
-: Class phpmailer\r
-</TITLE>\r
-<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">\r
-</HEAD>\r
-<BODY BGCOLOR="white">\r
-\r
-<!-- ========== START OF NAVBAR ========== -->\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc on Sat Mar 30 14:15:49 EST 2002 -->
+<TITLE>
+: Class phpmailer
+</TITLE>
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+</HEAD>
+<BODY BGCOLOR="white">
+
+<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
-<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">\r
-<TR>\r
-<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">\r
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+<TR>
+<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
-<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">\r
- <TR ALIGN="center" VALIGN="top">\r
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>\r
- </TR>\r
-</TABLE>\r
-</TD>\r
-<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>\r
-</EM>\r
-</TD>\r
-</TR>\r
-\r
-<TR>\r
-<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
- PREV CLASS \r
- NEXT CLASS</FONT></TD>\r
-<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
- <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A> \r
- <A HREF="phpmailer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>\r
-</TR>\r
-<TR>\r
-<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
- SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>\r
-<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
-DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>\r
-</TR>\r
-</TABLE>\r
-<!-- =========== END OF NAVBAR =========== -->\r
-\r
-<HR>\r
-<!-- ======== START OF CLASS DATA ======== -->\r
-<H2>\r
-Class phpmailer</H2>\r
-<PRE>\r
-<B>phpmailer</B>\r
-</PRE>\r
-<HR>\r
-<DL>\r
-<DT>public class <B>phpmailer</B></DL>\r
-\r
-<P>\r
-phpmailer - PHP email transport class\r
-<P>\r
-<HR>\r
-\r
-<P>\r
-<!-- ======== INNER CLASS SUMMARY ======== -->\r
-\r
-\r
-<!-- =========== FIELD SUMMARY =========== -->\r
-\r
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+</EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="Boundary.html"><B>PREV CLASS</B></A>
+ NEXT CLASS</FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="phpmailer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
+</TR>
+<TR>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+ SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
+</TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<HR>
+<!-- ======== START OF CLASS DATA ======== -->
+<H2>
+Class phpmailer</H2>
+<PRE>
+<B>phpmailer</B>
+</PRE>
+<HR>
+<DL>
+<DT>public class <B>phpmailer</B></DL>
+
+<P>
+phpmailer - PHP email transport class
+<P>
+<HR>
+
+<P>
+<!-- ======== INNER CLASS SUMMARY ======== -->
+
+
+<!-- =========== FIELD SUMMARY =========== -->
+
<A NAME="field_summary"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=2><FONT SIZE="+2">\r
-<B>Field Summary</B></FONT></TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$AltBody">$AltBody</A></B></CODE>\r
-\r
-<BR>\r
- Sets the text-only body of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Body">$Body</A></B></CODE>\r
-\r
-<BR>\r
- Sets the Body of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$CharSet">$CharSet</A></B></CODE>\r
-\r
-<BR>\r
- Sets the CharSet of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$ContentType">$ContentType</A></B></CODE>\r
-\r
-<BR>\r
- Sets the Content-type of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Encoding">$Encoding</A></B></CODE>\r
-\r
-<BR>\r
- Sets the Encoding of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$ErrorInfo">$ErrorInfo</A></B></CODE>\r
-\r
-<BR>\r
- Holds the most recent mailer error message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$From">$From</A></B></CODE>\r
-\r
-<BR>\r
- Sets the From email address for the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$FromName">$FromName</A></B></CODE>\r
-\r
-<BR>\r
- Sets the From name of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Helo">$Helo</A></B></CODE>\r
-\r
-<BR>\r
- Sets the SMTP HELO of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Host">$Host</A></B></CODE>\r
-\r
-<BR>\r
- Sets the SMTP hosts.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Mailer">$Mailer</A></B></CODE>\r
-\r
-<BR>\r
- Method to send mail: ("mail", "sendmail", or "smtp").</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Password">$Password</A></B></CODE>\r
-\r
-<BR>\r
- Sets SMTP password.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> int</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Port">$Port</A></B></CODE>\r
-\r
-<BR>\r
- Sets the default SMTP server port.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> int</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Priority">$Priority</A></B></CODE>\r
-\r
-<BR>\r
- Email priority (1 = High, 3 = Normal, 5 = low).</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Sender">$Sender</A></B></CODE>\r
-\r
-<BR>\r
- Sets the Sender email of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Sendmail">$Sendmail</A></B></CODE>\r
-\r
-<BR>\r
- Sets the path of the sendmail program.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> bool</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$SMTPAuth">$SMTPAuth</A></B></CODE>\r
-\r
-<BR>\r
- Sets SMTP authentication.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Subject">$Subject</A></B></CODE>\r
-\r
-<BR>\r
- Sets the Subject of the message.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> bool</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$UseMSMailHeaders">$UseMSMailHeaders</A></B></CODE>\r
-\r
-<BR>\r
- Turns Microsoft mail client headers on and off.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Username">$Username</A></B></CODE>\r
-\r
-<BR>\r
- Sets SMTP username.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> string</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$Version">$Version</A></B></CODE>\r
-\r
-<BR>\r
- Holds phpmailer version.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> int</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#$WordWrap">$WordWrap</A></B></CODE>\r
-\r
-<BR>\r
- Sets word wrapping on the message.</TD>\r
-</TR>\r
-</TABLE>\r
- \r
-<!-- ======== CONSTRUCTOR SUMMARY ======== -->\r
-\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Field Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$AltBody">$AltBody</A></B></CODE>
+
+<BR>
+ Sets the text-only body of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Body">$Body</A></B></CODE>
+
+<BR>
+ Sets the Body of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$CharSet">$CharSet</A></B></CODE>
+
+<BR>
+ Sets the CharSet of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$ConfirmReadingTo">$ConfirmReadingTo</A></B></CODE>
+
+<BR>
+ Sets the email address that a reading confirmation will be sent.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$ContentType">$ContentType</A></B></CODE>
+
+<BR>
+ Sets the Content-type of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Encoding">$Encoding</A></B></CODE>
+
+<BR>
+ Sets the Encoding of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$ErrorInfo">$ErrorInfo</A></B></CODE>
+
+<BR>
+ Holds the most recent mailer error message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$From">$From</A></B></CODE>
+
+<BR>
+ Sets the From email address for the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$FromName">$FromName</A></B></CODE>
+
+<BR>
+ Sets the From name of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Helo">$Helo</A></B></CODE>
+
+<BR>
+ Sets the SMTP HELO of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Host">$Host</A></B></CODE>
+
+<BR>
+ Sets the SMTP hosts.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$LE">$LE</A></B></CODE>
+
+<BR>
+ Sets the line endings of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Mailer">$Mailer</A></B></CODE>
+
+<BR>
+ Method to send mail: ("mail", "sendmail", or "smtp").</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Password">$Password</A></B></CODE>
+
+<BR>
+ Sets SMTP password.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$PluginDir">$PluginDir</A></B></CODE>
+
+<BR>
+ Path to phpmailer plugins.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Port">$Port</A></B></CODE>
+
+<BR>
+ Sets the default SMTP server port.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Priority">$Priority</A></B></CODE>
+
+<BR>
+ Email priority (1 = High, 3 = Normal, 5 = low).</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Sender">$Sender</A></B></CODE>
+
+<BR>
+ Sets the Sender email of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Sendmail">$Sendmail</A></B></CODE>
+
+<BR>
+ Sets the path of the sendmail program.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> bool</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$SMTPAuth">$SMTPAuth</A></B></CODE>
+
+<BR>
+ Sets SMTP authentication.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Subject">$Subject</A></B></CODE>
+
+<BR>
+ Sets the Subject of the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> bool</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$UseMSMailHeaders">$UseMSMailHeaders</A></B></CODE>
+
+<BR>
+ Turns Microsoft mail client headers on and off.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Username">$Username</A></B></CODE>
+
+<BR>
+ Sets SMTP username.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$Version">$Version</A></B></CODE>
+
+<BR>
+ Holds phpmailer version.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#$WordWrap">$WordWrap</A></B></CODE>
+
+<BR>
+ Sets word wrapping on the body of the message to a given number of
+ characters.</TD>
+</TR>
+</TABLE>
+
+<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+
<A NAME="constructor_summary"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=2><FONT SIZE="+2">\r
-<B>Constructor Summary</B></FONT></TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD><CODE><B><A HREF="phpmailer.html#phpmailer()">phpmailer</A></B>()</CODE>\r
-\r
-<BR>\r
- </TD>\r
-</TR>\r
-</TABLE>\r
- \r
-<!-- ========== METHOD SUMMARY =========== -->\r
-\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Constructor Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE><B><A HREF="phpmailer.html#phpmailer()">phpmailer</A></B>()</CODE>
+
+<BR>
+ </TD>
+</TR>
+</TABLE>
+
+<!-- ========== METHOD SUMMARY =========== -->
+
<A NAME="method_summary"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=2><FONT SIZE="+2">\r
-<B>Method Summary</B></FONT></TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Method Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddAddress(var, var)">AddAddress</A></B>(var $address,
- var $name)</CODE>\r
-\r
-<BR>\r
- Adds a "To" address.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> bool</CODE></FONT></TD>\r
+ var $name)</CODE>
+
+<BR>
+ Adds a "To" address.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> bool</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddAttachment(var, var, var, var)">AddAttachment</A></B>(var $path,
var $name,
var $encoding,
- var $type)</CODE>\r
-\r
-<BR>\r
- Adds an attachment from a path on the filesystem.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
+ var $type)</CODE>
+
+<BR>
+ Adds an attachment from a path on the filesystem.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddBCC(var, var)">AddBCC</A></B>(var $address,
- var $name)</CODE>\r
-\r
-<BR>\r
- Adds a "Bcc" address.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
+ var $name)</CODE>
+
+<BR>
+ Adds a "Bcc" address.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddCC(var, var)">AddCC</A></B>(var $address,
- var $name)</CODE>\r
-\r
-<BR>\r
- Adds a "Cc" address.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#AddCustomHeader(var)">AddCustomHeader</A></B>(var $custom_header)</CODE>\r
-\r
-<BR>\r
- Adds a custom header.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
+ var $name)</CODE>
+
+<BR>
+ Adds a "Cc" address.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#AddCustomHeader(var)">AddCustomHeader</A></B>(var $custom_header)</CODE>
+
+<BR>
+ Adds a custom header.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> bool</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#AddEmbeddedImage(var, var, var, var, var)">AddEmbeddedImage</A></B>(var $path,
+ var $cid,
+ var $name,
+ var $encoding,
+ var $type)</CODE>
+
+<BR>
+ Adds an embedded attachment.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddReplyTo(var, var)">AddReplyTo</A></B>(var $address,
- var $name)</CODE>\r
-\r
-<BR>\r
- Adds a "Reply-to" address.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
+ var $name)</CODE>
+
+<BR>
+ Adds a "Reply-to" address.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="phpmailer.html#AddStringAttachment(var, var, var, var)">AddStringAttachment</A></B>(var $string,
var $filename,
var $encoding,
- var $type)</CODE>\r
-\r
-<BR>\r
- Adds a string or binary attachment (non-filesystem) to the list.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearAddresses()">ClearAddresses</A></B>()</CODE>\r
-\r
-<BR>\r
- Clears all recipients assigned in the TO array.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearAllRecipients()">ClearAllRecipients</A></B>()</CODE>\r
-\r
-<BR>\r
+ var $type)</CODE>
+
+<BR>
+ Adds a string or binary attachment (non-filesystem) to the list.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearAddresses()">ClearAddresses</A></B>()</CODE>
+
+<BR>
+ Clears all recipients assigned in the TO array.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearAllRecipients()">ClearAllRecipients</A></B>()</CODE>
+
+<BR>
Clears all recipients assigned in the TO, CC and BCC
- array.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearAttachments()">ClearAttachments</A></B>()</CODE>\r
-\r
-<BR>\r
+ array.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearAttachments()">ClearAttachments</A></B>()</CODE>
+
+<BR>
Clears all previously set filesystem, string, and binary
- attachments.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearBCCs()">ClearBCCs</A></B>()</CODE>\r
-\r
-<BR>\r
- Clears all recipients assigned in the BCC array.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearCCs()">ClearCCs</A></B>()</CODE>\r
-\r
-<BR>\r
- Clears all recipients assigned in the CC array.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearCustomHeaders()">ClearCustomHeaders</A></B>()</CODE>\r
-\r
-<BR>\r
- Clears all custom headers.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#ClearReplyTos()">ClearReplyTos</A></B>()</CODE>\r
-\r
-<BR>\r
- Clears all recipients assigned in the ReplyTo array.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#IsHTML(var)">IsHTML</A></B>(var $bool)</CODE>\r
-\r
-<BR>\r
- Sets message type to HTML.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#IsMail()">IsMail</A></B>()</CODE>\r
-\r
-<BR>\r
- Sets Mailer to send message using PHP mail() function.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#IsQmail()">IsQmail</A></B>()</CODE>\r
-\r
-<BR>\r
- Sets Mailer to send message using the qmail MTA.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#IsSendmail()">IsSendmail</A></B>()</CODE>\r
-\r
-<BR>\r
- Sets Mailer to send message using the $Sendmail program.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> void</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#IsSMTP()">IsSMTP</A></B>()</CODE>\r
-\r
-<BR>\r
- Sets Mailer to send message using SMTP.</TD>\r
-</TR>\r
-<TR BGCOLOR="white" CLASS="TableRowColor">\r
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
-<CODE> bool</CODE></FONT></TD>\r
-<TD><CODE><B><A HREF="phpmailer.html#Send()">Send</A></B>()</CODE>\r
-\r
-<BR>\r
- Creates message and assigns Mailer.</TD>\r
-</TR>\r
-</TABLE>\r
- \r
-<P>\r
-\r
-<!-- ============ FIELD DETAIL =========== -->\r
-\r
+ attachments.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearBCCs()">ClearBCCs</A></B>()</CODE>
+
+<BR>
+ Clears all recipients assigned in the BCC array.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearCCs()">ClearCCs</A></B>()</CODE>
+
+<BR>
+ Clears all recipients assigned in the CC array.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearCustomHeaders()">ClearCustomHeaders</A></B>()</CODE>
+
+<BR>
+ Clears all custom headers.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#ClearReplyTos()">ClearReplyTos</A></B>()</CODE>
+
+<BR>
+ Clears all recipients assigned in the ReplyTo array.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#IsHTML(var)">IsHTML</A></B>(var $bool)</CODE>
+
+<BR>
+ Sets message type to HTML.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#IsMail()">IsMail</A></B>()</CODE>
+
+<BR>
+ Sets Mailer to send message using PHP mail() function.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#IsQmail()">IsQmail</A></B>()</CODE>
+
+<BR>
+ Sets Mailer to send message using the qmail MTA.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#IsSendmail()">IsSendmail</A></B>()</CODE>
+
+<BR>
+ Sets Mailer to send message using the $Sendmail program.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#IsSMTP()">IsSMTP</A></B>()</CODE>
+
+<BR>
+ Sets Mailer to send message using SMTP.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> bool</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#Send()">Send</A></B>()</CODE>
+
+<BR>
+ Creates message and assigns Mailer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> string</CODE></FONT></TD>
+<TD><CODE><B><A HREF="phpmailer.html#SendToQueue(var, var)">SendToQueue</A></B>(var $queue_path,
+ var $send_time)</CODE>
+
+<BR>
+ Sends mail message to an assigned queue directory.</TD>
+</TR>
+</TABLE>
+
+<P>
+
+<!-- ============ FIELD DETAIL =========== -->
+
<A NAME="field_detail"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=1><FONT SIZE="+2">\r
-<B>Field Detail</B></FONT></TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<A NAME="$Priority"><!-- --></A><H3>\r
-$Priority</H3>\r
-<PRE>\r
-public int <B>$Priority</B></PRE>\r
-<DL>\r
-<DD>Email priority (1 = High, 3 = Normal, 5 = low). Default value is 3.</DL>\r
-<HR>\r
-\r
-<A NAME="$CharSet"><!-- --></A><H3>\r
-$CharSet</H3>\r
-<PRE>\r
-public string <B>$CharSet</B></PRE>\r
-<DL>\r
-<DD>Sets the CharSet of the message. Default value is "iso-8859-1".</DL>\r
-<HR>\r
-\r
-<A NAME="$ContentType"><!-- --></A><H3>\r
-$ContentType</H3>\r
-<PRE>\r
-public string <B>$ContentType</B></PRE>\r
-<DL>\r
-<DD>Sets the Content-type of the message. Default value is "text/plain".</DL>\r
-<HR>\r
-\r
-<A NAME="$Encoding"><!-- --></A><H3>\r
-$Encoding</H3>\r
-<PRE>\r
-public string <B>$Encoding</B></PRE>\r
-<DL>\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=1><FONT SIZE="+2">
+<B>Field Detail</B></FONT></TD>
+</TR>
+</TABLE>
+
+<A NAME="$Priority"><!-- --></A><H3>
+$Priority</H3>
+<PRE>
+public int <B>$Priority</B></PRE>
+<DL>
+<DD>Email priority (1 = High, 3 = Normal, 5 = low). Default value is 3.</DL>
+<HR>
+
+<A NAME="$CharSet"><!-- --></A><H3>
+$CharSet</H3>
+<PRE>
+public string <B>$CharSet</B></PRE>
+<DL>
+<DD>Sets the CharSet of the message. Default value is "iso-8859-1".</DL>
+<HR>
+
+<A NAME="$ContentType"><!-- --></A><H3>
+$ContentType</H3>
+<PRE>
+public string <B>$ContentType</B></PRE>
+<DL>
+<DD>Sets the Content-type of the message. Default value is "text/plain".</DL>
+<HR>
+
+<A NAME="$Encoding"><!-- --></A><H3>
+$Encoding</H3>
+<PRE>
+public string <B>$Encoding</B></PRE>
+<DL>
<DD>Sets the Encoding of the message. Options for this are "8bit" (default),
- "7bit", "binary", "base64", and "quoted-printable".</DL>\r
-<HR>\r
-\r
-<A NAME="$ErrorInfo"><!-- --></A><H3>\r
-$ErrorInfo</H3>\r
-<PRE>\r
-public string <B>$ErrorInfo</B></PRE>\r
-<DL>\r
-<DD>Holds the most recent mailer error message. Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$From"><!-- --></A><H3>\r
-$From</H3>\r
-<PRE>\r
-public string <B>$From</B></PRE>\r
-<DL>\r
-<DD>Sets the From email address for the message. Default value is "root@localhost".</DL>\r
-<HR>\r
-\r
-<A NAME="$FromName"><!-- --></A><H3>\r
-$FromName</H3>\r
-<PRE>\r
-public string <B>$FromName</B></PRE>\r
-<DL>\r
-<DD>Sets the From name of the message. Default value is "Root User".</DL>\r
-<HR>\r
-\r
-<A NAME="$Sender"><!-- --></A><H3>\r
-$Sender</H3>\r
-<PRE>\r
-public string <B>$Sender</B></PRE>\r
-<DL>\r
+ "7bit", "binary", "base64", and "quoted-printable".</DL>
+<HR>
+
+<A NAME="$ErrorInfo"><!-- --></A><H3>
+$ErrorInfo</H3>
+<PRE>
+public string <B>$ErrorInfo</B></PRE>
+<DL>
+<DD>Holds the most recent mailer error message. Default value is "".</DL>
+<HR>
+
+<A NAME="$From"><!-- --></A><H3>
+$From</H3>
+<PRE>
+public string <B>$From</B></PRE>
+<DL>
+<DD>Sets the From email address for the message. Default value is "root@localhost".</DL>
+<HR>
+
+<A NAME="$FromName"><!-- --></A><H3>
+$FromName</H3>
+<PRE>
+public string <B>$FromName</B></PRE>
+<DL>
+<DD>Sets the From name of the message. Default value is "Root User".</DL>
+<HR>
+
+<A NAME="$Sender"><!-- --></A><H3>
+$Sender</H3>
+<PRE>
+public string <B>$Sender</B></PRE>
+<DL>
<DD>Sets the Sender email of the message. If not empty, will be sent via -f to sendmail
- or as 'MAIL FROM' in smtp mode. Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$Subject"><!-- --></A><H3>\r
-$Subject</H3>\r
-<PRE>\r
-public string <B>$Subject</B></PRE>\r
-<DL>\r
-<DD>Sets the Subject of the message. Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$Body"><!-- --></A><H3>\r
-$Body</H3>\r
-<PRE>\r
-public string <B>$Body</B></PRE>\r
-<DL>\r
+ or as 'MAIL FROM' in smtp mode. Default value is "".</DL>
+<HR>
+
+<A NAME="$Subject"><!-- --></A><H3>
+$Subject</H3>
+<PRE>
+public string <B>$Subject</B></PRE>
+<DL>
+<DD>Sets the Subject of the message. Default value is "".</DL>
+<HR>
+
+<A NAME="$Body"><!-- --></A><H3>
+$Body</H3>
+<PRE>
+public string <B>$Body</B></PRE>
+<DL>
<DD>Sets the Body of the message. This can be either an HTML or text body.
- If HTML then run IsHTML(true). Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$AltBody"><!-- --></A><H3>\r
-$AltBody</H3>\r
-<PRE>\r
-public string <B>$AltBody</B></PRE>\r
-<DL>\r
+ If HTML then run IsHTML(true). Default value is "".</DL>
+<HR>
+
+<A NAME="$AltBody"><!-- --></A><H3>
+$AltBody</H3>
+<PRE>
+public string <B>$AltBody</B></PRE>
+<DL>
<DD>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.
- Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$WordWrap"><!-- --></A><H3>\r
-$WordWrap</H3>\r
-<PRE>\r
-public int <B>$WordWrap</B></PRE>\r
-<DL>\r
-<DD>Sets word wrapping on the message. Default value is 0 (off).</DL>\r
-<HR>\r
-\r
-<A NAME="$Mailer"><!-- --></A><H3>\r
-$Mailer</H3>\r
-<PRE>\r
-public string <B>$Mailer</B></PRE>\r
-<DL>\r
+ Default value is "".</DL>
+<HR>
+
+<A NAME="$WordWrap"><!-- --></A><H3>
+$WordWrap</H3>
+<PRE>
+public int <B>$WordWrap</B></PRE>
+<DL>
+<DD>Sets word wrapping on the body of the message to a given number of
+ characters. Default value is 0 (off).</DL>
+<HR>
+
+<A NAME="$Mailer"><!-- --></A><H3>
+$Mailer</H3>
+<PRE>
+public string <B>$Mailer</B></PRE>
+<DL>
<DD>Method to send mail: ("mail", "sendmail", or "smtp").
- Default value is "mail".</DL>\r
-<HR>\r
-\r
-<A NAME="$Sendmail"><!-- --></A><H3>\r
-$Sendmail</H3>\r
-<PRE>\r
-public string <B>$Sendmail</B></PRE>\r
-<DL>\r
+ Default value is "mail".</DL>
+<HR>
+
+<A NAME="$Sendmail"><!-- --></A><H3>
+$Sendmail</H3>
+<PRE>
+public string <B>$Sendmail</B></PRE>
+<DL>
<DD>Sets the path of the sendmail program. Default value is
- "/usr/sbin/sendmail".</DL>\r
-<HR>\r
-\r
-<A NAME="$UseMSMailHeaders"><!-- --></A><H3>\r
-$UseMSMailHeaders</H3>\r
-<PRE>\r
-public bool <B>$UseMSMailHeaders</B></PRE>\r
-<DL>\r
+ "/usr/sbin/sendmail".</DL>
+<HR>
+
+<A NAME="$UseMSMailHeaders"><!-- --></A><H3>
+$UseMSMailHeaders</H3>
+<PRE>
+public bool <B>$UseMSMailHeaders</B></PRE>
+<DL>
<DD>Turns Microsoft mail client headers on and off. Useful mostly
- for older clients. Default value is false (off).</DL>\r
-<HR>\r
-\r
-<A NAME="$Version"><!-- --></A><H3>\r
-$Version</H3>\r
-<PRE>\r
-public string <B>$Version</B></PRE>\r
-<DL>\r
-<DD>Holds phpmailer version.</DL>\r
-<HR>\r
-\r
-<A NAME="$Host"><!-- --></A><H3>\r
-$Host</H3>\r
-<PRE>\r
-public string <B>$Host</B></PRE>\r
-<DL>\r
+ for older clients. Default value is false (off).</DL>
+<HR>
+
+<A NAME="$PluginDir"><!-- --></A><H3>
+$PluginDir</H3>
+<PRE>
+public string <B>$PluginDir</B></PRE>
+<DL>
+<DD>Path to phpmailer plugins. This is now only useful if the SMTP class
+ is in a different directory than the PHP include path.
+ Default is empty ("").</DL>
+<HR>
+
+<A NAME="$Version"><!-- --></A><H3>
+$Version</H3>
+<PRE>
+public string <B>$Version</B></PRE>
+<DL>
+<DD>Holds phpmailer version.</DL>
+<HR>
+
+<A NAME="$ConfirmReadingTo"><!-- --></A><H3>
+$ConfirmReadingTo</H3>
+<PRE>
+public string <B>$ConfirmReadingTo</B></PRE>
+<DL>
+<DD>Sets the email address that a reading confirmation will be sent. Default value is "".</DL>
+<HR>
+
+<A NAME="$LE"><!-- --></A><H3>
+$LE</H3>
+<PRE>
+public string <B>$LE</B></PRE>
+<DL>
+<DD>Sets the line endings of the message. Default is "\n";</DL>
+<HR>
+
+<A NAME="$Host"><!-- --></A><H3>
+$Host</H3>
+<PRE>
+public string <B>$Host</B></PRE>
+<DL>
<DD>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.domain.com:25;smtp2.domain.com").
Hosts will be tried in order.
- Default value is "localhost".</DL>\r
-<HR>\r
-\r
-<A NAME="$Port"><!-- --></A><H3>\r
-$Port</H3>\r
-<PRE>\r
-public int <B>$Port</B></PRE>\r
-<DL>\r
-<DD>Sets the default SMTP server port. Default value is 25.</DL>\r
-<HR>\r
-\r
-<A NAME="$Helo"><!-- --></A><H3>\r
-$Helo</H3>\r
-<PRE>\r
-public string <B>$Helo</B></PRE>\r
-<DL>\r
+ Default value is "localhost".</DL>
+<HR>
+
+<A NAME="$Port"><!-- --></A><H3>
+$Port</H3>
+<PRE>
+public int <B>$Port</B></PRE>
+<DL>
+<DD>Sets the default SMTP server port. Default value is 25.</DL>
+<HR>
+
+<A NAME="$Helo"><!-- --></A><H3>
+$Helo</H3>
+<PRE>
+public string <B>$Helo</B></PRE>
+<DL>
<DD>Sets the SMTP HELO of the message.
- Default value is "localhost.localdomain".</DL>\r
-<HR>\r
-\r
-<A NAME="$SMTPAuth"><!-- --></A><H3>\r
-$SMTPAuth</H3>\r
-<PRE>\r
-public bool <B>$SMTPAuth</B></PRE>\r
-<DL>\r
+ Default value is "localhost.localdomain".</DL>
+<HR>
+
+<A NAME="$SMTPAuth"><!-- --></A><H3>
+$SMTPAuth</H3>
+<PRE>
+public bool <B>$SMTPAuth</B></PRE>
+<DL>
<DD>Sets SMTP authentication. Utilizes the Username and Password variables.
- Default value is false (off).</DL>\r
-<HR>\r
-\r
-<A NAME="$Username"><!-- --></A><H3>\r
-$Username</H3>\r
-<PRE>\r
-public string <B>$Username</B></PRE>\r
-<DL>\r
-<DD>Sets SMTP username. Default value is "".</DL>\r
-<HR>\r
-\r
-<A NAME="$Password"><!-- --></A><H3>\r
-$Password</H3>\r
-<PRE>\r
-public string <B>$Password</B></PRE>\r
-<DL>\r
-<DD>Sets SMTP password. Default value is "".</DL>\r
-\r
-<!-- ========= CONSTRUCTOR DETAIL ======== -->\r
-\r
+ Default value is false (off).</DL>
+<HR>
+
+<A NAME="$Username"><!-- --></A><H3>
+$Username</H3>
+<PRE>
+public string <B>$Username</B></PRE>
+<DL>
+<DD>Sets SMTP username. Default value is "".</DL>
+<HR>
+
+<A NAME="$Password"><!-- --></A><H3>
+$Password</H3>
+<PRE>
+public string <B>$Password</B></PRE>
+<DL>
+<DD>Sets SMTP password. Default value is "".</DL>
+
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
+
<A NAME="constructor_detail"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=1><FONT SIZE="+2">\r
-<B>Constructor Detail</B></FONT></TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<A NAME="phpmailer()"><!-- --></A><H3>\r
-phpmailer</H3>\r
-<PRE>\r
-public <B>phpmailer</B>()</PRE>\r
-<DL>\r
-</DL>\r
-\r
-<!-- ============ METHOD DETAIL ========== -->\r
-\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=1><FONT SIZE="+2">
+<B>Constructor Detail</B></FONT></TD>
+</TR>
+</TABLE>
+
+<A NAME="phpmailer()"><!-- --></A><H3>
+phpmailer</H3>
+<PRE>
+public <B>phpmailer</B>()</PRE>
+<DL>
+</DL>
+
+<!-- ============ METHOD DETAIL ========== -->
+
<A NAME="method_detail"><!-- --></A>
-<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">\r
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
-<TD COLSPAN=1><FONT SIZE="+2">\r
-<B>Method Detail</B></FONT></TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<A NAME="IsHTML(var)"><!-- --></A><H3>\r
-IsHTML</H3>\r
-<PRE>\r
-public void <B>IsHTML</B>(var $bool)</PRE>\r
-<DL>\r
-<DD>Sets message type to HTML. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="IsSMTP()"><!-- --></A><H3>\r
-IsSMTP</H3>\r
-<PRE>\r
-public void <B>IsSMTP</B>()</PRE>\r
-<DL>\r
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=1><FONT SIZE="+2">
+<B>Method Detail</B></FONT></TD>
+</TR>
+</TABLE>
+
+<A NAME="IsHTML(var)"><!-- --></A><H3>
+IsHTML</H3>
+<PRE>
+public void <B>IsHTML</B>(var $bool)</PRE>
+<DL>
+<DD>Sets message type to HTML. Returns void.</DL>
+<HR>
+
+<A NAME="IsSMTP()"><!-- --></A><H3>
+IsSMTP</H3>
+<PRE>
+public void <B>IsSMTP</B>()</PRE>
+<DL>
<DD>Sets Mailer to send message using SMTP.
- Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="IsMail()"><!-- --></A><H3>\r
-IsMail</H3>\r
-<PRE>\r
-public void <B>IsMail</B>()</PRE>\r
-<DL>\r
+ Returns void.</DL>
+<HR>
+
+<A NAME="IsMail()"><!-- --></A><H3>
+IsMail</H3>
+<PRE>
+public void <B>IsMail</B>()</PRE>
+<DL>
<DD>Sets Mailer to send message using PHP mail() function.
- Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="IsSendmail()"><!-- --></A><H3>\r
-IsSendmail</H3>\r
-<PRE>\r
-public void <B>IsSendmail</B>()</PRE>\r
-<DL>\r
+ Returns void.</DL>
+<HR>
+
+<A NAME="IsSendmail()"><!-- --></A><H3>
+IsSendmail</H3>
+<PRE>
+public void <B>IsSendmail</B>()</PRE>
+<DL>
<DD>Sets Mailer to send message using the $Sendmail program.
- Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="IsQmail()"><!-- --></A><H3>\r
-IsQmail</H3>\r
-<PRE>\r
-public void <B>IsQmail</B>()</PRE>\r
-<DL>\r
-<DD>Sets Mailer to send message using the qmail MTA. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="AddAddress(var, var)"><!-- --></A><H3>\r
-AddAddress</H3>\r
-<PRE>\r
+ Returns void.</DL>
+<HR>
+
+<A NAME="IsQmail()"><!-- --></A><H3>
+IsQmail</H3>
+<PRE>
+public void <B>IsQmail</B>()</PRE>
+<DL>
+<DD>Sets Mailer to send message using the qmail MTA. Returns void.</DL>
+<HR>
+
+<A NAME="AddAddress(var, var)"><!-- --></A><H3>
+AddAddress</H3>
+<PRE>
public void <B>AddAddress</B>(var $address,
- var $name)</PRE>\r
-<DL>\r
-<DD>Adds a "To" address. Returns void.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="AddCC(var, var)"><!-- --></A><H3>\r
-AddCC</H3>\r
-<PRE>\r
+ var $name)</PRE>
+<DL>
+<DD>Adds a "To" address. Returns void.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddCC(var, var)"><!-- --></A><H3>
+AddCC</H3>
+<PRE>
public void <B>AddCC</B>(var $address,
- var $name)</PRE>\r
-<DL>\r
+ var $name)</PRE>
+<DL>
<DD>Adds a "Cc" address. Note: this function works
with the SMTP mailer on win32, not with the "mail"
mailer. This is a PHP bug that has been submitted
- on http: * functions correctly. Returns void.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="AddBCC(var, var)"><!-- --></A><H3>\r
-AddBCC</H3>\r
-<PRE>\r
+ on http: * functions correctly. Returns void.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddBCC(var, var)"><!-- --></A><H3>
+AddBCC</H3>
+<PRE>
public void <B>AddBCC</B>(var $address,
- var $name)</PRE>\r
-<DL>\r
+ var $name)</PRE>
+<DL>
<DD>Adds a "Bcc" address. Note: this function works
with the SMTP mailer on win32, not with the "mail"
mailer. This is a PHP bug that has been submitted
on http: * functions correctly.
- Returns void.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="AddReplyTo(var, var)"><!-- --></A><H3>\r
-AddReplyTo</H3>\r
-<PRE>\r
+ Returns void.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddReplyTo(var, var)"><!-- --></A><H3>
+AddReplyTo</H3>
+<PRE>
public void <B>AddReplyTo</B>(var $address,
- var $name)</PRE>\r
-<DL>\r
-<DD>Adds a "Reply-to" address. Returns void.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="Send()"><!-- --></A><H3>\r
-Send</H3>\r
-<PRE>\r
-public bool <B>Send</B>()</PRE>\r
-<DL>\r
+ var $name)</PRE>
+<DL>
+<DD>Adds a "Reply-to" address. Returns void.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="Send()"><!-- --></A><H3>
+Send</H3>
+<PRE>
+public bool <B>Send</B>()</PRE>
+<DL>
<DD>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. Returns bool.</DL>\r
-<HR>\r
-\r
-<A NAME="AddAttachment(var, var, var, var)"><!-- --></A><H3>\r
-AddAttachment</H3>\r
-<PRE>\r
+ variable to view description of the error. Returns bool.</DL>
+<HR>
+
+<A NAME="SendToQueue(var, var)"><!-- --></A><H3>
+SendToQueue</H3>
+<PRE>
+public string <B>SendToQueue</B>(var $queue_path,
+ var $send_time)</PRE>
+<DL>
+<DD>Sends mail message to an assigned queue directory. Has an optional
+ sendTime argument. This is used when the user wants the
+ message to be sent from the queue at a predetermined time.
+ The data must be a valid timestamp like that returned from
+ the time() or strtotime() functions. Returns false on failure
+ or the message file name if success.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$send_time</CODE> - <b>Default Value</b>: 0</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddAttachment(var, var, var, var)"><!-- --></A><H3>
+AddAttachment</H3>
+<PRE>
public bool <B>AddAttachment</B>(var $path,
var $name,
var $encoding,
- var $type)</PRE>\r
-<DL>\r
+ var $type)</PRE>
+<DL>
<DD>Adds an attachment from a path on the filesystem.
Checks if attachment is valid and then adds
the attachment to the list.
Returns false if the file could not be found
- or accessed.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""<DD><CODE>$encoding</CODE> - <b>Default Value</b>: "base64"<DD><CODE>$type</CODE> - <b>Default Value</b>: "application/octet-stream"</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="AddStringAttachment(var, var, var, var)"><!-- --></A><H3>\r
-AddStringAttachment</H3>\r
-<PRE>\r
+ or accessed.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$name</CODE> - <b>Default Value</b>: ""<DD><CODE>$encoding</CODE> - <b>Default Value</b>: "base64"<DD><CODE>$type</CODE> - <b>Default Value</b>: "application/octet-stream"</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddStringAttachment(var, var, var, var)"><!-- --></A><H3>
+AddStringAttachment</H3>
+<PRE>
public void <B>AddStringAttachment</B>(var $string,
var $filename,
var $encoding,
- var $type)</PRE>\r
-<DL>\r
+ var $type)</PRE>
+<DL>
<DD>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.<DD><DL>\r
-<DT><B>Parameters:</B><DD><CODE>$encoding</CODE> - <b>Default Value</b>: "base64"<DD><CODE>$type</CODE> - <b>Default Value</b>: "application/octet-stream"</DL>\r
-</DD>\r
-</DL>\r
-<HR>\r
-\r
-<A NAME="ClearAddresses()"><!-- --></A><H3>\r
-ClearAddresses</H3>\r
-<PRE>\r
-public void <B>ClearAddresses</B>()</PRE>\r
-<DL>\r
-<DD>Clears all recipients assigned in the TO array. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearCCs()"><!-- --></A><H3>\r
-ClearCCs</H3>\r
-<PRE>\r
-public void <B>ClearCCs</B>()</PRE>\r
-<DL>\r
-<DD>Clears all recipients assigned in the CC array. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearBCCs()"><!-- --></A><H3>\r
-ClearBCCs</H3>\r
-<PRE>\r
-public void <B>ClearBCCs</B>()</PRE>\r
-<DL>\r
-<DD>Clears all recipients assigned in the BCC array. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearReplyTos()"><!-- --></A><H3>\r
-ClearReplyTos</H3>\r
-<PRE>\r
-public void <B>ClearReplyTos</B>()</PRE>\r
-<DL>\r
-<DD>Clears all recipients assigned in the ReplyTo array. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearAllRecipients()"><!-- --></A><H3>\r
-ClearAllRecipients</H3>\r
-<PRE>\r
-public void <B>ClearAllRecipients</B>()</PRE>\r
-<DL>\r
+ such as a BLOB record from a database.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>$encoding</CODE> - <b>Default Value</b>: "base64"<DD><CODE>$type</CODE> - <b>Default Value</b>: "application/octet-stream"</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="AddEmbeddedImage(var, var, var, var, var)"><!-- --></A><H3>
+AddEmbeddedImage</H3>
+<PRE>
+public bool <B>AddEmbeddedImage</B>(var $path,
+ var $cid,
+ var $name,
+ var $encoding,
+ var $type)</PRE>
+<DL>
+<DD>Adds an embedded attachment. This can include images, sounds, and
+ just about any other document.<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>cid</CODE> - this is the Content Id of the attachment. Use this to identify
+ the Id for accessing the image in an HTML form.<DD><CODE>$name</CODE> - <b>Default Value</b>: ""<DD><CODE>$encoding</CODE> - <b>Default Value</b>: "base64"<DD><CODE>$type</CODE> - <b>Default Value</b>: "application/octet-stream"</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="ClearAddresses()"><!-- --></A><H3>
+ClearAddresses</H3>
+<PRE>
+public void <B>ClearAddresses</B>()</PRE>
+<DL>
+<DD>Clears all recipients assigned in the TO array. Returns void.</DL>
+<HR>
+
+<A NAME="ClearCCs()"><!-- --></A><H3>
+ClearCCs</H3>
+<PRE>
+public void <B>ClearCCs</B>()</PRE>
+<DL>
+<DD>Clears all recipients assigned in the CC array. Returns void.</DL>
+<HR>
+
+<A NAME="ClearBCCs()"><!-- --></A><H3>
+ClearBCCs</H3>
+<PRE>
+public void <B>ClearBCCs</B>()</PRE>
+<DL>
+<DD>Clears all recipients assigned in the BCC array. Returns void.</DL>
+<HR>
+
+<A NAME="ClearReplyTos()"><!-- --></A><H3>
+ClearReplyTos</H3>
+<PRE>
+public void <B>ClearReplyTos</B>()</PRE>
+<DL>
+<DD>Clears all recipients assigned in the ReplyTo array. Returns void.</DL>
+<HR>
+
+<A NAME="ClearAllRecipients()"><!-- --></A><H3>
+ClearAllRecipients</H3>
+<PRE>
+public void <B>ClearAllRecipients</B>()</PRE>
+<DL>
<DD>Clears all recipients assigned in the TO, CC and BCC
- array. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearAttachments()"><!-- --></A><H3>\r
-ClearAttachments</H3>\r
-<PRE>\r
-public void <B>ClearAttachments</B>()</PRE>\r
-<DL>\r
+ array. Returns void.</DL>
+<HR>
+
+<A NAME="ClearAttachments()"><!-- --></A><H3>
+ClearAttachments</H3>
+<PRE>
+public void <B>ClearAttachments</B>()</PRE>
+<DL>
<DD>Clears all previously set filesystem, string, and binary
- attachments. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="ClearCustomHeaders()"><!-- --></A><H3>\r
-ClearCustomHeaders</H3>\r
-<PRE>\r
-public void <B>ClearCustomHeaders</B>()</PRE>\r
-<DL>\r
-<DD>Clears all custom headers. Returns void.</DL>\r
-<HR>\r
-\r
-<A NAME="AddCustomHeader(var)"><!-- --></A><H3>\r
-AddCustomHeader</H3>\r
-<PRE>\r
-public void <B>AddCustomHeader</B>(var $custom_header)</PRE>\r
-<DL>\r
-<DD>Adds a custom header. Returns void.</DL>\r
-<!-- ========= END OF CLASS DATA ========= -->\r
-<HR>\r
-\r
-<!-- ========== START OF NAVBAR ========== -->\r
+ attachments. Returns void.</DL>
+<HR>
+
+<A NAME="ClearCustomHeaders()"><!-- --></A><H3>
+ClearCustomHeaders</H3>
+<PRE>
+public void <B>ClearCustomHeaders</B>()</PRE>
+<DL>
+<DD>Clears all custom headers. Returns void.</DL>
+<HR>
+
+<A NAME="AddCustomHeader(var)"><!-- --></A><H3>
+AddCustomHeader</H3>
+<PRE>
+public void <B>AddCustomHeader</B>(var $custom_header)</PRE>
+<DL>
+<DD>Adds a custom header. Returns void.</DL>
+<!-- ========= END OF CLASS DATA ========= -->
+<HR>
+
+<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
-<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">\r
-<TR>\r
-<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">\r
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+<TR>
+<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
-<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">\r
- <TR ALIGN="center" VALIGN="top">\r
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>\r
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>\r
- </TR>\r
-</TABLE>\r
-</TD>\r
-<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>\r
-</EM>\r
-</TD>\r
-</TR>\r
-\r
-<TR>\r
-<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
- PREV CLASS \r
- NEXT CLASS</FONT></TD>\r
-<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
- <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A> \r
- <A HREF="phpmailer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>\r
-</TR>\r
-<TR>\r
-<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
- SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>\r
-<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
-DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>\r
-</TR>\r
-</TABLE>\r
-<!-- =========== END OF NAVBAR =========== -->\r
-\r
-<HR>\r
-\r
-</BODY>\r
-</HTML>\r
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+</EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="Boundary.html"><B>PREV CLASS</B></A>
+ NEXT CLASS</FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="phpmailer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
+</TR>
+<TR>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+ SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
+</TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<HR>
+
+</BODY>
+</HTML>
--- /dev/null
+<?php
+/*******************
+ Unit Test
+ Type: phpmailer class
+********************/
+
+$INCLUDE_DIR = "";
+
+require("phpunit.php");
+require($INCLUDE_DIR . "class.phpmailer.php");
+error_reporting(E_ALL);
+
+/**
+ * Performs authentication tests
+ */
+class phpmailerTest extends TestCase
+{
+ /**
+ * Holds the default phpmailer instance.
+ * @private
+ * @type object
+ */
+ var $Mail = false;
+
+ /**
+ * Holds the SMTP mail host.
+ * @public
+ * @type string
+ */
+ var $Host = "";
+
+ /**
+ * Holds the change log.
+ * @private
+ * @type string array
+ */
+ var $ChangeLog = array();
+
+ /**
+ * Holds the note log.
+ * @private
+ * @type string array
+ */
+ var $NoteLog = array();
+
+ /**
+ * Class constuctor.
+ */
+ function phpmailerTest($name) {
+ /* must define this constructor */
+ $this->TestCase( $name );
+ }
+
+ /**
+ * Run before each test is started.
+ */
+ function setUp() {
+ global $global_vars;
+ global $INCLUDE_DIR;
+
+ $this->Mail = new phpmailer();
+
+ $this->Mail->Priority = 3;
+ $this->Mail->Encoding = "8bit";
+ $this->Mail->CharSet = "iso-8859-1";
+ $this->Mail->From = "unit_test@phpmailer.sf.net";
+ $this->Mail->FromName = "Unit Tester";
+ $this->Mail->Sender = "";
+ $this->Mail->Subject = "Unit Test";
+ $this->Mail->Body = "";
+ $this->Mail->AltBody = "";
+ $this->Mail->WordWrap = 0;
+ $this->Mail->Host = $global_vars["mail_host"];
+ $this->Mail->Port = 25;
+ $this->Mail->Helo = "localhost.localdomain";
+ $this->Mail->SMTPAuth = false;
+ $this->Mail->Username = "";
+ $this->Mail->Password = "";
+ $this->Mail->PluginDir = $INCLUDE_DIR;
+ $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");
+
+ if(strlen($this->Mail->Host) > 0)
+ $this->Mail->Mailer = "smtp";
+ else
+ {
+ $this->Mail->Mailer = "mail";
+ $this->Sender = "unit_test@phpmailer.sf.net";
+ }
+
+ global $global_vars;
+ $this->SetAddress($global_vars["mail_to"]);
+
+ // This is where you might place additional To, Bcc, etc addresses
+ }
+
+ /**
+ * Run after each test is completed.
+ */
+ function tearDown() {
+ // Clean global variables
+ $this->Mail = false;
+ $this->ChangeLog = array();
+ $this->NoteLog = array();
+ }
+
+
+ /**
+ * Build the body of the message in the appropriate format.
+ * @private
+ * @returns void
+ */
+ function BuildBody() {
+ $this->CheckChanges();
+
+ // Determine line endings for message
+ if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)
+ {
+ $eol = "<br/>";
+ $bullet = "<li>";
+ $bullet_start = "<ul>";
+ $bullet_end = "</ul>";
+ }
+ else
+ {
+ $eol = "\n";
+ $bullet = " - ";
+ $bullet_start = "";
+ $bullet_end = "";
+ }
+
+ $ReportBody = "";
+
+ $ReportBody .= "---------------------" . $eol;
+ $ReportBody .= "Unit Test Information" . $eol;
+ $ReportBody .= "---------------------" . $eol;
+ $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
+ $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
+
+ if(strlen($this->Mail->Host) > 0)
+ $ReportBody .= "Host: " . $this->Mail->Host . $eol;
+
+ // If attachments then create an attachment list
+ if(count($this->Mail->attachment) > 0)
+ {
+ $ReportBody .= "Attachments";
+ $ReportBody .= $bullet_start;
+ for($i = 0; $i < count($this->Mail->attachment); $i++)
+ {
+ $ReportBody .= $bullet . "Name: " . $this->Mail->attachment[$i][1] . ", ";
+ $ReportBody .= "Encoding: " . $this->Mail->attachment[$i][3] . ", ";
+ $ReportBody .= "Type: " . $this->Mail->attachment[$i][4] . $eol;
+ }
+ $ReportBody .= $bullet_end . $eol;
+ }
+
+ // If there are changes then list them
+ if(count($this->ChangeLog) > 0)
+ {
+ $ReportBody .= "Changes" . $eol;
+ $ReportBody .= "-------" . $eol;
+
+ $ReportBody .= $bullet_start;
+ for($i = 0; $i < count($this->ChangeLog); $i++)
+ {
+ $ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" .
+ $this->ChangeLog[$i][1] . "]" . $eol;
+ }
+ $ReportBody .= $bullet_end . $eol . $eol;
+ }
+
+ // If there are notes then list them
+ if(count($this->NoteLog) > 0)
+ {
+ $ReportBody .= "Notes" . $eol;
+ $ReportBody .= "-----" . $eol;
+
+ $ReportBody .= $bullet_start;
+ for($i = 0; $i < count($this->NoteLog); $i++)
+ {
+ $ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
+ }
+ $ReportBody .= $bullet_end;
+ }
+
+ // Re-attach the original body
+ $this->Mail->Body .= $eol . $eol . $ReportBody;
+ }
+
+ /**
+ * Check which default settings have been changed for the report.
+ * @private
+ * @returns void
+ */
+ function CheckChanges() {
+ if($this->Mail->Priority != 3)
+ $this->AddChange("Priority", $this->Mail->Priority);
+ if($this->Mail->Encoding != "8bit")
+ $this->AddChange("Encoding", $this->Mail->Encoding);
+ if($this->Mail->CharSet != "iso-8859-1")
+ $this->AddChange("CharSet", $this->Mail->CharSet);
+ if($this->Mail->Sender != "")
+ $this->AddChange("Sender", $this->Mail->Sender);
+ if($this->Mail->WordWrap != 0)
+ $this->AddChange("WordWrap", $this->Mail->WordWrap);
+ if($this->Mail->Mailer != "mail")
+ $this->AddChange("Mailer", $this->Mail->Mailer);
+ if($this->Mail->Port != 25)
+ $this->AddChange("Port", $this->Mail->Port);
+ if($this->Mail->Helo != "localhost.localdomain")
+ $this->AddChange("Helo", $this->Mail->Helo);
+ if($this->Mail->SMTPAuth)
+ $this->AddChange("SMTPAuth", "true");
+ }
+
+ /**
+ * Adds a change entry.
+ * @private
+ * @returns void
+ */
+ function AddChange($sName, $sNewValue) {
+ $cur = count($this->ChangeLog);
+ $this->ChangeLog[$cur][0] = $sName;
+ $this->ChangeLog[$cur][1] = $sNewValue;
+ }
+
+ /**
+ * Adds a simple note to the message.
+ * @public
+ * @returns void
+ */
+ function AddNote($sValue) {
+ $this->NoteLog[] = $sValue;
+ }
+
+ /**
+ * Adds all of the addresses
+ * @public
+ * @returns void
+ */
+ function SetAddress($sAddress, $sName = "", $sType = "to") {
+ switch($sType)
+ {
+ case "to":
+ $this->Mail->AddAddress($sAddress, $sName);
+ break;
+ case "cc":
+ $this->Mail->AddCC($sAddress, $sName);
+ break;
+ case "bcc":
+ $this->Mail->AddBCC($sAddress, $sName);
+ break;
+ }
+ }
+
+ /////////////////////////////////////////////////
+ // UNIT TESTS
+ /////////////////////////////////////////////////
+
+ /**
+ * Try a plain message.
+ */
+ function test_WordWrap() {
+
+ $this->Mail->WordWrap = 40;
+ $my_body = "Here is the main body of this message. It should " .
+ "be quite a few lines. It should be wrapped at the " .
+ "40 characters. Make sure that it is.";
+ $nBodyLen = strlen($my_body);
+ $my_body .= "\n\nThis is the above body length: " . $nBodyLen;
+
+ $this->Mail->Body = $my_body;
+ $this->Mail->Subject .= ": Wordwrap";
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Try a plain message.
+ */
+ function test_Low_Priority() {
+
+ $this->Mail->Priority = 5;
+ $this->Mail->Body = "Here is the main body. There should be " .
+ "a reply to address in this message.";
+ $this->Mail->Subject .= ": Low Priority";
+ $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Simple plain file attachment test.
+ */
+ function test_Plain_FileAttachment() {
+
+ $this->Mail->Body = "Here is the text body";
+ $this->Mail->Subject .= ": Plain and FileAttachment";
+
+ if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Simple plain string attachment test.
+ */
+ function test_Plain_StringAttachment() {
+
+ $this->Mail->Body = "Here is the text body";
+ $this->Mail->Subject .= ": Plain and StringAttachment";
+
+ $sAttachment = "These characters are the content of the " .
+ "string attachment.\nThis might be taken from a ".
+ "database or some other such thing. ";
+
+ $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Plain quoted-printable message.
+ */
+ function test_Quoted_Printable() {
+
+ $this->Mail->Body = "Here is the main body";
+ $this->Mail->Subject .= ": Plain and Quoted-printable";
+ $this->Mail->Encoding = "quoted-printable";
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Try a plain message.
+ */
+ function test_Html() {
+
+ $this->Mail->IsHTML(true);
+ $this->Mail->Subject .= ": HTML only";
+
+ $this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
+ "Go to <a href=\"http://phpmailer.sourceforge.net/\">" .
+ "http://phpmailer.sourceforge.net/</a> for new versions of " .
+ "phpmailer. <p/> Thank you!";
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Simple HTML and attachment test
+ */
+ function test_HTML_Attachment() {
+
+ $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+ $this->Mail->Subject .= ": HTML and Attachment";
+ $this->Mail->IsHTML(true);
+
+ if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * An embedded attachment test.
+ */
+ function test_Embedded_Image() {
+
+ $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
+ "Here is an image!</a>";
+ $this->Mail->Subject .= ": Embedded Image";
+ $this->Mail->IsHTML(true);
+
+ if(!$this->Mail->AddEmbeddedImage("rocks.png", "my-attach", "rocks.png"))
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ if($this->Mail->EmbeddedImageCount() < 0)
+ {
+ $this->assert(false, "Embedded image count below 1");
+ return;
+ }
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Simple multipart/alternative test.
+ */
+ function test_AltBody() {
+
+ $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+ $this->Mail->AltBody = "This is the text part of the email.";
+ $this->AddNote("This is a mulipart alternative email");
+ $this->Mail->Subject .= ": AltBody";
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+ /**
+ * Simple HTML and attachment test
+ */
+ function test_AltBody_Attachment() {
+
+ $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+ $this->Mail->AltBody = "This is the text part of the email.";
+ $this->Mail->Subject .= ": AltBody and Attachment";
+ $this->Mail->IsHTML(true);
+
+ if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->BuildBody();
+ if(!$this->Mail->Send())
+ {
+ $this->assert(false, $this->Mail->ErrorInfo);
+ return;
+ }
+
+ $this->assert(true);
+ }
+
+}
+
+/**
+ * Create and run test instance.
+ */
+
+if(isset($HTTP_GET_VARS))
+ $global_vars = $HTTP_GET_VARS;
+else
+ $global_vars = $_REQUEST;
+
+if(isset($global_vars["submitted"]))
+{
+ echo "Test results:<br>";
+ $suite = new TestSuite( "phpmailerTest" );
+
+ $testRunner = new TestRunner;
+ $testRunner->run($suite);
+ echo "<hr noshade/>";
+}
+
+function get($sName) {
+ global $global_vars;
+ if(isset($global_vars[$sName]))
+ return $global_vars[$sName];
+ else
+ return "";
+}
+
+?>
+
+<html>
+<body>
+<h3>phpmailer Unit Test</h3>
+By entering a SMTP hostname it will automatically perform tests with SMTP.
+
+<form name="phpmailer_unit" action="phpmailer_test.php" method="get">
+<input type="hidden" name="submitted" value="1"/>
+To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>
+<br/>
+Bcc Address: <input type="text" size="50" name="mail_bcc" value="<?php echo get("mail_bcc"); ?>"/>
+<br/>
+SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>
+<p/>
+<input type="submit" value="Run Test"/>
+
+</form>
+</body>
+</html>
--- /dev/null
+<?php
+//
+// PHP framework for testing, based on the design of "JUnit".
+//
+// Written by Fred Yankowski <fred@ontosys.com>
+// OntoSys, Inc <http://www.OntoSys.com>
+//
+// $Id$
+
+// Copyright (c) 2000 Fred Yankowski
+
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies
+// of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+//
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |
+ E_CORE_ERROR | E_CORE_WARNING);
+
+/*
+interface Test {
+ function run(&$aTestResult);
+ function countTestCases();
+}
+*/
+
+function trace($msg) {
+ return;
+ print($msg);
+ flush();
+}
+
+
+class Exception {
+ /* Emulate a Java exception, sort of... */
+ var $message;
+ function Exception($message) {
+ $this->message = $message;
+ }
+ function getMessage() {
+ return $this->message;
+ }
+}
+
+class Assert {
+ function assert($boolean, $message=0) {
+ if (! $boolean)
+ $this->fail($message);
+ }
+
+ function assertEquals($expected, $actual, $message=0) {
+ if ($expected != $actual) {
+ $this->failNotEquals($expected, $actual, "expected", $message);
+ }
+ }
+
+ function assertRegexp($regexp, $actual, $message=false) {
+ if (! preg_match($regexp, $actual)) {
+ $this->failNotEquals($regexp, $actual, "pattern", $message);
+ }
+ }
+
+ function failNotEquals($expected, $actual, $expected_label, $message=0) {
+ // Private function for reporting failure to match.
+ $str = $message ? ($message . ' ') : '';
+ $str .= "($expected_label/actual)<br>";
+ $htmlExpected = htmlspecialchars($expected);
+ $htmlActual = htmlspecialchars($actual);
+ $str .= sprintf("<pre>%s\n--------\n%s</pre>",
+ $htmlExpected, $htmlActual);
+ $this->fail($str);
+ }
+}
+
+class TestCase extends Assert /* implements Test */ {
+ /* Defines context for running tests. Specific context -- such as
+ instance variables, global variables, global state -- is defined
+ by creating a subclass that specializes the setUp() and
+ tearDown() methods. A specific test is defined by a subclass
+ that specializes the runTest() method. */
+ var $fName;
+ var $fResult;
+ var $fExceptions = array();
+
+ function TestCase($name) {
+ $this->fName = $name;
+ }
+
+ function run($testResult=0) {
+ /* Run this single test, by calling the run() method of the
+ TestResult object which will in turn call the runBare() method
+ of this object. That complication allows the TestResult object
+ to do various kinds of progress reporting as it invokes each
+ test. Create/obtain a TestResult object if none was passed in.
+ Note that if a TestResult object was passed in, it must be by
+ reference. */
+ if (! $testResult)
+ $testResult = $this->_createResult();
+ $this->fResult = $testResult;
+ $testResult->run(&$this);
+ $this->fResult = 0;
+ return $testResult;
+ }
+
+ function countTestCases() {
+ return 1;
+ }
+
+ function runTest() {
+ $name = $this->name();
+ // Since isset($this->$name) is false, no way to run defensive checks
+ $this->$name();
+ }
+
+ function setUp() /* expect override */ {
+ //print("TestCase::setUp()<br>\n");
+ }
+
+ function tearDown() /* possible override */ {
+ //print("TestCase::tearDown()<br>\n");
+ }
+
+ ////////////////////////////////////////////////////////////////
+
+
+ function _createResult() /* protected */ {
+ /* override this to use specialized subclass of TestResult */
+ return new TestResult;
+ }
+
+ function fail($message=0) {
+ //printf("TestCase::fail(%s)<br>\n", ($message) ? $message : '');
+ /* JUnit throws AssertionFailedError here. We just record the
+ failure and carry on */
+ $this->fExceptions[] = new Exception(&$message);
+ }
+
+ function error($message) {
+ /* report error that requires correction in the test script
+ itself, or (heaven forbid) in this testing infrastructure */
+ printf('<b>ERROR: ' . $message . '</b><br>');
+ $this->fResult->stop();
+ }
+
+ function failed() {
+ return count($this->fExceptions);
+ }
+
+ function getExceptions() {
+ return $this->fExceptions;
+ }
+
+ function name() {
+ return $this->fName;
+ }
+
+ function runBare() {
+ $this->setup();
+ $this->runTest();
+ $this->tearDown();
+ }
+}
+
+
+class TestSuite /* implements Test */ {
+ /* Compose a set of Tests (instances of TestCase or TestSuite), and
+ run them all. */
+ var $fTests = array();
+
+ function TestSuite($classname=false) {
+ if ($classname) {
+ // Find all methods of the given class whose name starts with
+ // "test" and add them to the test suite. We are just _barely_
+ // able to do this with PHP's limited introspection... Note
+ // that PHP seems to store method names in lower case, and we
+ // have to avoid the constructor function for the TestCase class
+ // superclass. This will fail when $classname starts with
+ // "Test" since that will have a constructor method that will
+ // get matched below and then treated (incorrectly) as a test
+ // method. So don't name any TestCase subclasses as "Test..."!
+ if (floor(phpversion()) >= 4) {
+ // PHP4 introspection, submitted by Dylan Kuhn
+ $names = get_class_methods($classname);
+ while (list($key, $method) = each($names)) {
+ if (preg_match('/^test/', $method) && $method != "testcase") {
+ $this->addTest(new $classname($method));
+ }
+ }
+ }
+ else {
+ $dummy = new $classname("dummy");
+ $names = (array) $dummy;
+ while (list($key, $value) = each($names)) {
+ $type = gettype($value);
+ if ($type == "user function" && preg_match('/^test/', $key)
+ && $key != "testcase") {
+ $this->addTest(new $classname($key));
+ }
+ }
+ }
+ }
+ }
+
+ function addTest($test) {
+ /* Add TestCase or TestSuite to this TestSuite */
+ $this->fTests[] = $test;
+ }
+
+ function run(&$testResult) {
+ /* Run all TestCases and TestSuites comprising this TestSuite,
+ accumulating results in the given TestResult object. */
+ reset($this->fTests);
+ while (list($na, $test) = each($this->fTests)) {
+ if ($testResult->shouldStop())
+ break;
+ $test->run(&$testResult);
+ }
+ }
+
+ function countTestCases() {
+ /* Number of TestCases comprising this TestSuite (including those
+ in any constituent TestSuites) */
+ $count = 0;
+ reset($fTests);
+ while (list($na, $test_case) = each($this->fTests)) {
+ $count += $test_case->countTestCases();
+ }
+ return $count;
+ }
+}
+
+
+class TestFailure {
+ /* Record failure of a single TestCase, associating it with the
+ exception(s) that occurred */
+ var $fFailedTestName;
+ var $fExceptions;
+
+ function TestFailure(&$test, &$exceptions) {
+ $this->fFailedTestName = $test->name();
+ $this->fExceptions = $exceptions;
+ }
+
+ function getExceptions() {
+ return $this->fExceptions;
+ }
+ function getTestName() {
+ return $this->fFailedTestName;
+ }
+}
+
+
+class TestResult {
+ /* Collect the results of running a set of TestCases. */
+ var $fFailures = array();
+ var $fRunTests = 0;
+ var $fStop = false;
+
+ function TestResult() { }
+
+ function _endTest($test) /* protected */ {
+ /* specialize this for end-of-test action, such as progress
+ reports */
+ }
+
+ function getFailures() {
+ return $this->fFailures;
+ }
+
+ function run($test) {
+ /* Run a single TestCase in the context of this TestResult */
+ $this->_startTest($test);
+ $this->fRunTests++;
+
+ $test->runBare();
+
+ /* this is where JUnit would catch AssertionFailedError */
+ $exceptions = $test->getExceptions();
+ if ($exceptions)
+ $this->fFailures[] = new TestFailure(&$test, &$exceptions);
+ $this->_endTest($test);
+ }
+
+ function countTests() {
+ return $this->fRunTests;
+ }
+
+ function shouldStop() {
+ return $this->fStop;
+ }
+
+ function _startTest($test) /* protected */ {
+ /* specialize this for start-of-test actions */
+ }
+
+ function stop() {
+ /* set indication that the test sequence should halt */
+ $fStop = true;
+ }
+
+ function countFailures() {
+ return count($this->fFailures);
+ }
+}
+
+
+class TextTestResult extends TestResult {
+ /* Specialize TestResult to produce text/html report */
+ function TextTestResult() {
+ $this->TestResult(); // call superclass constructor
+ }
+
+ function report() {
+ /* report result of test run */
+ $nRun = $this->countTests();
+ $nFailures = $this->countFailures();
+ printf("<p>%s test%s run<br>", $nRun, ($nRun == 1) ? '' : 's');
+ printf("%s failure%s.<br>\n", $nFailures, ($nFailures == 1) ? '' : 's');
+ if ($nFailures == 0)
+ return;
+
+ print("<ol>\n");
+ $failures = $this->getFailures();
+ while (list($i, $failure) = each($failures)) {
+ $failedTestName = $failure->getTestName();
+ printf("<li>%s\n", $failedTestName);
+
+ $exceptions = $failure->getExceptions();
+ print("<ul>");
+ while (list($na, $exception) = each($exceptions))
+ printf("<li>%s\n", $exception->getMessage());
+ print("</ul>");
+ }
+ print("</ol>\n");
+ }
+
+ function _startTest($test) {
+ printf("%s ", $test->name());
+ flush();
+ }
+
+ function _endTest($test) {
+ $outcome = $test->failed()
+ ? "<font color=\"red\">FAIL</font>"
+ : "<font color=\"green\">ok</font>";
+ printf("$outcome<br>\n");
+ flush();
+ }
+}
+
+
+class TestRunner {
+ /* Run a suite of tests and report results. */
+ function run($suite) {
+ $result = new TextTestResult;
+ $suite->run($result);
+ $result->report();
+ }
+}
+
+?>