Email-Stuffer-0.018000755000765000024 013677717700 13430 5ustar00rjbsstaff000000000000README100644000765000024 63713677717700 14357 0ustar00rjbsstaff000000000000Email-Stuffer-0.018This archive contains the distribution Email-Stuffer, version 0.018: A more casual approach to creating and sending Email:: emails This software is copyright (c) 2004 by Adam Kennedy and Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.015. Changes100644000765000024 621413677717700 15007 0ustar00rjbsstaff000000000000Email-Stuffer-0.018Revision history for Perl extension Email::Stuffer 0.018 2020-07-03 17:14:36-04:00 America/New_York - document envelope argument to ->send (thanks, Dan Book) - fix a bug that prevented ->transport from being the first method called (thanks, Alastair Douglas) - fix a typo in the docs (thanks, Steve Dondley) - fix tests when using the latest Email::MIME (thanks, Russell Jenkins) 0.017 2018-03-10 18:01:43-05:00 America/New_York - "transport" can now be passed an arrayref in new - some minor documentation fixes 0.016 2017-08-31 09:41:07-04:00 America/New_York - email address fields (to, cc, etc) now use the address list support in newer Email::MIMEs (thanks, Pali Rohár) 0.015 2017-06-24 21:45:47-04:00 America/New_York (TRIAL RELEASE) - text parts are no longer format=flowed (Pali Rohár) - reply_to method added to set Reply-To 0.014 2016-04-30 19:28:26-04:00 America/New_York - you can now pass (some) properties of the email to the ->new method (thanks, John Napiorkowski) - attachments provided via IO::All get a binmode now - to/from/subject now always return $self, but will die if called with zero arguments 0.013 2016-04-08 20:34:49-04:00 America/New_York - allow mime-type picking by filename to work when the filename extension is not all lowercase (thanks, Chase Whitener) - remove Test::Most; Test::More is enough Test for us 0.012 2015-02-15 20:01:01-05:00 America/New_York - test for ENOENT text based on platform under test, not fixed string 0.011 2015-02-15 11:31:01-05:00 America/New_York - autodetect PDF filetype (thanks, mannih) 0.010 2014-04-25 10:24:49-04:00 America/New_York (TRIAL RELEASE) - in case of failure, throw exceptions rather than returning undef 0.009 2013-11-24 22:40:49 America/New_York - update required version of Email::Stuffer 0.008 2013-09-29 15:47:10 America/New_York - correct the documentation of header-setting methods to match their behavior (since Email::Stuff's first release) - add tests to show we can set an empty subject through ->header but not through ->subject 0.007 2013-08-22 17:26:45 America/New_York - allow ->to, ->cc, and ->bcc to take a list of addresses (thanks, Kris Matthews!) 0.006 2013-07-02 10:58:46 America/New_York fix stupid packaging error: $VERSION was wrong! 0.005 2013-07-01 22:54:50 America/New_York fix version of Params::Util required 0.004 2013-06-25 13:43:42 America/New_York - replace File::Type with a much simpler and smaller-scale check (thanks, tokuhirom!) with File::Type gone, no need to use prefork anymore (thanks, tokuhirom!) 0.003 2013-06-18 23:36:39 America/New_York correctly implement the send_or_die method (thanks, Ross Attrill!) documentation corrections (thanks, Ross Attrill!) repackage using Dist::Zilla 0.001 2013-05-30 first released, forked from Email::Stuff 2.102 LICENSE100644000765000024 4374613677717700 14554 0ustar00rjbsstaff000000000000Email-Stuffer-0.018This software is copyright (c) 2004 by Adam Kennedy and Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2004 by Adam Kennedy and Ricardo SIGNES. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's 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 General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) 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. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the 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 Program specifies a version number of the 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 Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2004 by Adam Kennedy and Ricardo SIGNES. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End dist.ini100644000765000024 40013677717700 15127 0ustar00rjbsstaff000000000000Email-Stuffer-0.018name = Email-Stuffer author = Adam Kennedy author = Ricardo SIGNES license = Perl_5 copyright_holder = Adam Kennedy and Ricardo SIGNES copyright_year = 2004 [@RJBS] [Encoding] match = ^t/data/ encoding = bytes META.yml100644000765000024 3140713677717700 15007 0ustar00rjbsstaff000000000000Email-Stuffer-0.018--- abstract: 'A more casual approach to creating and sending Email:: emails' author: - 'Adam Kennedy ' - 'Ricardo SIGNES ' build_requires: Email::Sender::Transport::Test: '0.120000' ExtUtils::MakeMaker: '0' File::Spec: '0' File::Spec::Functions: '0' Moo: '0' Test::Fatal: '0' Test::More: '0.96' utf8: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.015, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Email-Stuffer requires: Carp: '0' Email::MIME: '1.943' Email::MIME::Creator: '0' Email::Sender::Simple: '0' File::Basename: '0' Module::Runtime: '0' Params::Util: '1.05' Scalar::Util: '0' perl: '5.005' strict: '0' warnings: '0' resources: bugtracker: https://github.com/rjbs/Email-Stuffer/issues homepage: https://github.com/rjbs/Email-Stuffer repository: https://github.com/rjbs/Email-Stuffer.git version: '0.018' x_Dist_Zilla: perl: version: '5.032000' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@RJBS/Git::GatherDir' version: '2.046' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build run_under_travis: 0 skip: [] name: '@RJBS/RJBS-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release run_under_travis: 0 skip: [] name: '@RJBS/CPAN-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: '6.015' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: '6.015' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: '6.015' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: '6.015' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: '6.015' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: '6.015' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: '6.015' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: '6.015' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: '6.015' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: '6.015' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: '6.015' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' version: '6.015' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: '6.015' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: 0 version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: git_version: '2.24.3 (Apple Git-128)' repo_root: . name: '@RJBS/Git::NextVersion' version: '2.046' - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: '6.015' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: '6.015' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: '6.015' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: '6.015' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: '6.015' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: '6.015' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: '4.015' - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: '4.015' - class: Pod::Weaver::Section::Collect name: Attributes version: '4.015' - class: Pod::Weaver::Section::Collect name: Methods version: '4.015' - class: Pod::Weaver::Section::Collect name: Functions version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: '4.015' - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: '4.015' - class: Pod::Weaver::Section::Contributors name: '@RJBS/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: '4.015' name: '@RJBS/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: '2.24.3 (Apple Git-128)' repo_root: . name: '@RJBS/@Git/Check' version: '2.046' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%V%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: '2.24.3 (Apple Git-128)' repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Commit' version: '2.046' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '0.018' tag_format: '%v' tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: '2.24.3 (Apple Git-128)' repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Tag' version: '2.046' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - 'origin :' - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: git_version: '2.24.3 (Apple Git-128)' repo_root: . name: '@RJBS/@Git/Push' version: '2.046' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: '2.24.3 (Apple Git-128)' include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@RJBS/Git::Contributors' version: '0.035' - class: Dist::Zilla::Plugin::Encoding name: Encoding version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.015' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.015' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.015' x_contributors: - 'Aaron W. Swenson ' - 'adam ' - 'adamk@cpan.org ' - 'adam@phase-n.com ' - 'Alastair Douglas ' - 'Aristotle Pagaltzis ' - "Arthur Axel 'fREW' Schmidt " - 'Chase Whitener ' - 'CosmicNet ' - 'Dan Book ' - 'John Napiorkowski ' - 'Josh Stompro ' - 'Kevin Tew ' - 'Kieren Diment ' - 'Kris Matthews ' - 'Kris Matthews ' - 'Lee Johnson ' - 'Manni Heumann ' - 'Pali ' - 'Ricardo Signes ' - 'Ross Attrill ' - 'Russell Jenkins ' - 'Shawn Sorichetti ' - 'Steve Dondley ' - 'tokuhirom ' x_generated_by_perl: v5.32.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' MANIFEST100644000765000024 102313677717700 14636 0ustar00rjbsstaff000000000000Email-Stuffer-0.018# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.015. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Email/Stuffer.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/alternative.t t/basic.t t/content_type.t t/data/body.html t/data/empty.pdf t/data/paypal.gif t/data/paypal.jpg t/data/paypal.png t/data/paypal2.PNG t/header_to_or_replace.t t/init-arg.t t/send-or-die.t t/set-empty-subject.t t/singlepart.t t/slurp-mode.t xt/author/pod-syntax.t xt/release/changes_has_content.t t000755000765000024 013677717700 13614 5ustar00rjbsstaff000000000000Email-Stuffer-0.018basic.t100644000765000024 1402713677717700 15246 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl use strict; use warnings; use File::Spec::Functions ':ALL'; use Test::More; use Test::Fatal; use Email::Stuffer; my $TEST_GIF = catfile( 't', 'data', 'paypal.gif' ); ok( -f $TEST_GIF, "Found test image: $TEST_GIF" ); sub string_ok { my $string = shift; $string = !! (defined $string and ! ref $string and $string ne ''); ok( $string, $_[0] || 'Got a normal string' ); } sub stuff_ok { my $stuff = shift; isa_ok( $stuff, 'Email::Stuffer' ); isa_ok( $stuff->email, 'Email::MIME' ); string_ok( $stuff->as_string, 'Got a non-null string for Email::Stuffer->as_string' ); } ##################################################################### # Main Tests # Create a new Email::Stuffer object my $Stuffer = Email::Stuffer->new; stuff_ok( $Stuffer ); my @headers = $Stuffer->headers; ok( scalar(@headers), 'Even the default object has headers' ); # Set a To name my $rv = $Stuffer->to('adam@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->To returns the same object' ); is( $Stuffer->email->header('To'), 'adam@ali.as', '->To sets To header' ); # Set a From name $rv = $Stuffer->from('bob@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->From returns the same object' ); is( $Stuffer->email->header('From'), 'bob@ali.as', '->From sets From header' ); # To allows multiple recipients $rv = $Stuffer->to('adam@ali.as', 'another@ali.as', 'bob@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->To (multiple) returns the same object' ); is( $Stuffer->email->header('To'), 'adam@ali.as, another@ali.as, bob@ali.as', '->To (multiple) sets To header' ); my $error = exception { $Stuffer->to([ 'bob@ali.as', 'another@ali.as','adam@ali.as' ]) }; like( $error, qr/list of to headers contains unblessed ref/, 'to croaks when passed a reference', ); # Cc allows multiple recipients $rv = $Stuffer->cc('adam@ali.as', 'another@ali.as', 'bob@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->Cc (multiple) returns the same object' ); is( $Stuffer->email->header('Cc'), 'adam@ali.as, another@ali.as, bob@ali.as', '->Cc (multiple) sets To header' ); $error = exception { $Stuffer->cc([ 'bob@ali.as', 'another@ali.as','adam@ali.as' ]) }; like( $error, qr/list of cc headers contains unblessed ref/, 'cc croaks when passed a reference', ); # Bcc allows multiple recipients $rv = $Stuffer->bcc('adam@ali.as', 'another@ali.as', 'bob@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->Bcc (multiple) returns the same object' ); is( $Stuffer->email->header('Bcc'), 'adam@ali.as, another@ali.as, bob@ali.as', '->Bcc (multiple) sets To header' ); $error = exception { $Stuffer->bcc([ 'bob@ali.as', 'another@ali.as','adam@ali.as' ]) }; like( $error, qr/list of bcc headers contains unblessed ref/, 'bcc croaks when passed a reference', ); # Set a Reply-To address $rv = $Stuffer->reply_to('sue@ali.as'); stuff_ok( $Stuffer ); stuff_ok( $rv ); is( $Stuffer->as_string, $rv->as_string, '->reply_to returns the same object' ); is( $Stuffer->email->header('Reply-To'), 'sue@ali.as', '->reply_to sets Reply-To header' ); # More complex one use Email::Sender::Transport::Test 0.120000 (); # ->delivery_count, etc. my $test = Email::Sender::Transport::Test->new; my $rv2 = Email::Stuffer->from ( 'Adam Kennedy') ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->text_body ( 'I am an email' ) ->attach_file( $TEST_GIF ) ->transport ( $test ) ->send; ok( $rv2, 'Email sent ok' ); is( $test->delivery_count, 1, 'Sent one email' ); my $email = $test->shift_deliveries->{email}->as_string; like( $email, qr/Adam Kennedy/, 'Email contains from name' ); like( $email, qr/phase-n/, 'Email contains to string' ); like( $email, qr/Hello/, 'Email contains subject string' ); like( $email, qr/I am an email/, 'Email contains text_body' ); like( $email, qr/paypal/, 'Email contains file name' ); # attach_file content_type $rv2 = Email::Stuffer->from ( 'Adam Kennedy' ) ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->text_body ( 'I am an email' ) ->attach_file( 'dist.ini', content_type => 'text/plain') ->transport ( $test ) ->send; ok( $rv2, 'Email sent ok' ); is( $test->delivery_count, 1, 'Sent one email' ); $email = $test->shift_deliveries->{email}->as_string; like( $email, qr/Adam Kennedy/, 'Email contains from name' ); like( $email, qr/phase-n/, 'Email contains to string' ); like( $email, qr/Hello/, 'Email contains subject string' ); like( $email, qr/I am an email/, 'Email contains text_body' ); like( $email, qr{Content-Type: text/plain; name=(?:"dist\.ini"|dist\.ini)}, 'Email contains attachment content-Type' ); # attach_file with no such file $error = exception { Email::Stuffer->attach_file( 'no such file' ) }; like $error, qr/No such file 'no such file'/, 'attach_file croaks when passed a bad file name'; # attach_file with a non-file object $error = exception { Email::Stuffer->attach_file( $rv2 ) }; like $error, qr/Expected a file name or an IO::All::File derivative, got Email::Sender::Success/, 'attach_file croaks when passed a bad reference'; my $enoent = do { use Errno 'ENOENT'; local $! = ENOENT; "$!"; }; # _slurp croaks when passed a bad file $error = exception { Email::Stuffer::_slurp( 'no such file' ) }; like $error, qr/\Aerror opening no such file: \Q$enoent/, '_slurp croaks when passed a bad filename'; done_testing; 1; META.json100644000765000024 4664513677717700 15171 0ustar00rjbsstaff000000000000Email-Stuffer-0.018{ "abstract" : "A more casual approach to creating and sending Email:: emails", "author" : [ "Adam Kennedy ", "Ricardo SIGNES " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.015, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Email-Stuffer", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Encode" : "0", "Test::More" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Carp" : "0", "Email::MIME" : "1.943", "Email::MIME::Creator" : "0", "Email::Sender::Simple" : "0", "File::Basename" : "0", "Module::Runtime" : "0", "Params::Util" : "1.05", "Scalar::Util" : "0", "perl" : "5.005", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Email::Sender::Transport::Test" : "0.120000", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "File::Spec::Functions" : "0", "Moo" : "0", "Test::Fatal" : "0", "Test::More" : "0.96", "utf8" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Email-Stuffer/issues" }, "homepage" : "https://github.com/rjbs/Email-Stuffer", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Email-Stuffer.git", "web" : "https://github.com/rjbs/Email-Stuffer" } }, "version" : "0.018", "x_Dist_Zilla" : { "perl" : { "version" : "5.032000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@RJBS/Git::GatherDir", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@RJBS/MakeMaker", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 0, "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.24.3 (Apple Git-128)", "repo_root" : "." } }, "name" : "@RJBS/Git::NextVersion", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RJBS/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RJBS/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.015" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.24.3 (Apple Git-128)", "repo_root" : "." } }, "name" : "@RJBS/@Git/Check", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%V%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.24.3 (Apple Git-128)", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Commit", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "0.018", "tag_format" : "%v", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.24.3 (Apple Git-128)", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Tag", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin :", "github :" ], "remotes_must_exist" : 0 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.24.3 (Apple Git-128)", "repo_root" : "." } }, "name" : "@RJBS/@Git/Push", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.24.3 (Apple Git-128)", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@RJBS/Git::Contributors", "version" : "0.035" }, { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "Encoding", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.015" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.015" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.015" } }, "x_contributors" : [ "Aaron W. Swenson ", "adam ", "adamk@cpan.org ", "adam@phase-n.com ", "Alastair Douglas ", "Aristotle Pagaltzis ", "Arthur Axel 'fREW' Schmidt ", "Chase Whitener ", "CosmicNet ", "Dan Book ", "John Napiorkowski ", "Josh Stompro ", "Kevin Tew ", "Kieren Diment ", "Kris Matthews ", "Kris Matthews ", "Lee Johnson ", "Manni Heumann ", "Pali ", "Ricardo Signes ", "Ross Attrill ", "Russell Jenkins ", "Shawn Sorichetti ", "Steve Dondley ", "tokuhirom " ], "x_generated_by_perl" : "v5.32.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.19", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } Makefile.PL100644000765000024 363713677717700 15474 0ustar00rjbsstaff000000000000Email-Stuffer-0.018# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.015. use strict; use warnings; use 5.005; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "A more casual approach to creating and sending Email:: emails", "AUTHOR" => "Adam Kennedy , Ricardo SIGNES ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Email-Stuffer", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.005", "NAME" => "Email::Stuffer", "PREREQ_PM" => { "Carp" => 0, "Email::MIME" => "1.943", "Email::MIME::Creator" => 0, "Email::Sender::Simple" => 0, "File::Basename" => 0, "Module::Runtime" => 0, "Params::Util" => "1.05", "Scalar::Util" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Email::Sender::Transport::Test" => "0.120000", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "Moo" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "utf8" => 0 }, "VERSION" => "0.018", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Email::MIME" => "1.943", "Email::MIME::Creator" => 0, "Email::Sender::Simple" => 0, "Email::Sender::Transport::Test" => "0.120000", "ExtUtils::MakeMaker" => 0, "File::Basename" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "Module::Runtime" => 0, "Moo" => 0, "Params::Util" => "1.05", "Scalar::Util" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "strict" => 0, "utf8" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); init-arg.t100644000765000024 74413677717700 15640 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl use strict; use warnings; use Test::More; use Email::Stuffer; my $from = 'me@email.com'; my $to = [ 'you@example.com', 'them@example.mil' ]; my $stuffer = Email::Stuffer->new({ to => $to, from => $from, }); my $email = $stuffer->email; is_deeply( [ split /\s*,\s*/, $stuffer->email->header('To') ], [ @$to ], 'init-arg "to" sets To header', ); is( $stuffer->email->header('From'), $from, 'init-arg "from" sets From header', ); done_testing; singlepart.t100644000765000024 424513677717700 16316 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl -w use strict; use warnings; use Test::More qw[no_plan]; use Email::Stuffer; use Email::Sender::Transport::Test (); ##################################################################### # Single Part tests my $test = Email::Sender::Transport::Test->new; { # Single part text/plain my $rv = Email::Stuffer->from ( 'Adam Kennedy') ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->text_body ( 'I am an emáil' ) ->transport ( $test ) ->send; ok( $rv, 'Email sent ok' ); is( $test->delivery_count, 1, 'Sent one email' ); my $email = $test->shift_deliveries->{email}; my $string = $email->as_string; like( $string, qr/Adam Kennedy/, 'Email contains from name' ); like( $string, qr/phase-n/, 'Email contains to string' ); like( $string, qr/Hello/, 'Email contains subject string' ); like( $string, qr/Content-Type: text\/plain/, 'Email content type' ); like( $email->object->body_str, qr/I am an emáil/, 'Email contains text_body', ); } { # Single part html/text my $rv = Email::Stuffer->from ( 'Adam Kennedy') ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->html_body ( 'I am a html email' ) ->transport ( $test ) ->send; ok( $rv, 'Email sent ok' ); is( $test->delivery_count, 1, 'Sent another email' ); my $email = $test->shift_deliveries->{email}; my $string = $email->as_string; like( $string, qr/Adam Kennedy/, 'Email contains from name' ); like( $string, qr/phase-n/, 'Email contains to string' ); like( $string, qr/Hello/, 'Email contains subject string' ); like( $string, qr/I am a html email<\/b>/, 'Email contains text_body' ); like( $string, qr/Content-Type: text\/html/, 'Email content type' ); } 1; slurp-mode.t100644000765000024 135213677717700 16231 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/tuse strict; use warnings; use utf8; use Test::More; use File::Spec::Functions ':ALL'; use Email::Stuffer; if (! eval "require IO::All") { plan skip_all => "this test requires IO::All"; } sub io; IO::All->import('io'); # sadly this is only a windows test my $true_data = "\r\n\n\n\r\n"; my $TEST_ACID = catfile( 't', 'data', 'acid.bin' ); open my $fh, '>', $TEST_ACID; binmode $fh; print {$fh} $true_data; close $fh; ok( -f $TEST_ACID, "Found test acid: $TEST_ACID" ); my $mail = Email::Stuffer->from('cpan@example.com') ->to('santa@example.com') ->text_body("YAY") ->attach_file(io->file($TEST_ACID)) ->email; is(0+$mail->parts, 2, 'all parts found'); ok([$mail->parts]->[1]->body eq $true_data, 'not corrupt'); done_testing; alternative.t100644000765000024 301113677717700 16452 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl use strict; use warnings; use Test::More qw[no_plan]; use Email::Stuffer; use Email::Sender::Transport::Test (); ##################################################################### # Multipart/Alternate tests my $test = Email::Sender::Transport::Test->new; my $rv = Email::Stuffer->from ( 'Adam Kennedy') ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->text_body ( 'I am an emáil' ) ->html_body ( 'I am a html emáil' ) ->transport ( $test ) ->send; ok( $rv, 'Email sent ok' ); is( $test->delivery_count, 1, 'Sent one email' ); my $email = $test->shift_deliveries->{email}; my $string = $email->as_string; like( $string, qr/Adam Kennedy/, 'Email contains from name' ); like( $string, qr/phase-n/, 'Email contains to string' ); like( $string, qr/Hello/, 'Email contains subject string' ); like( $string, qr/Content-Type: multipart\/alternative/, 'Email content type' ); like( $string, qr/Content-Type: text\/plain/, 'Email content type' ); like( $string, qr/Content-Type: text\/html/, 'Email content type' ); my $mime = $email->object; like( ($mime->subparts)[0]->body_str, qr/I am an emáil/, 'Email contains text_body' ); like( ($mime->subparts)[1]->body_str, qr/I am a html emáil<\/b>/, 'Email contains text_body' ); 1; send-or-die.t100644000765000024 466613677717700 16263 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl -w use strict; use warnings; use Test::More qw[no_plan]; use Email::Stuffer; use Email::Sender::Transport::Test (); my $message = <<'END_MESSAGE'; From: sender@test.example.com To: recipient@nowhere.example.net Subject: this message is going nowhere fast Dear Recipient, You will never receive this. -- sender END_MESSAGE { package Email::Sender::Transport::TestFail; use Moo; extends 'Email::Sender::Transport::Test'; sub delivery_failure { my ($self, $email, $env) = @_; return Email::Sender::Failure->new('bad sender') if $env->{from} =~ /^reject@/; return; } sub recipient_failure { my ($self, $rcpt) = @_; if ($rcpt =~ /^fault@/) { return Email::Sender::Failure->new({ message => 'fault', recipients => [ $rcpt ], }); } if ($rcpt =~ /^tempfail@/) { return Email::Sender::Failure::Temporary->new({ message => 'tempfail', recipients => [ $rcpt ], }); } if ($rcpt =~ /^permfail@/) { return Email::Sender::Failure::Permanent->new({ message => 'permfail', recipients => [ $rcpt ], }); } return; } no Moo; } my $test = Email::Sender::Transport::Test->new; ##################################################################### # test send_or_die function { my $rv = Email::Stuffer->from ( 'Adam Kennedy') ->to ( 'adam@phase-n.com' ) ->subject ( 'Hello To:!' ) ->text_body ( 'Success' ) ->transport ( $test ) ->send_or_die; ok( $rv, 'we expect to succeed' ); is( $test->delivery_count, 1, 'Sent one email' ); } { my $fail_test = Email::Sender::Transport::TestFail->new(); my $rv2 = eval { my $rv = Email::Stuffer->from ( 'fault@example.com' ) ->to ( 'fault@example.com' ) ->subject ( 'Should fail' ) ->text_body ( 'Fail and die' ) ->transport ( $fail_test ) ->send_or_die; print "Fail rv: $rv"; return $rv; }; my $error = $@; is($rv2, undef, 'died as expected'); isa_ok($error, 'Email::Sender::Failure'); } content_type.t100644000765000024 421613677717700 16657 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/tuse strict; use warnings; use utf8; use Test::More tests => 17; use File::Spec::Functions ':ALL'; use Email::Stuffer; my $TEST_GIF = catfile( 't', 'data', 'paypal.gif' ); ok( -f $TEST_GIF, "Found test image: $TEST_GIF" ); my $TEST_JPG = catfile( 't', 'data', 'paypal.jpg' ); ok( -f $TEST_JPG, "Found test image: $TEST_JPG" ); my $TEST_PNG_UPPER = catfile( 't', 'data', 'paypal2.PNG' ); ok( -f $TEST_PNG_UPPER, "Found test image: $TEST_PNG_UPPER" ); my $TEST_PNG = catfile( 't', 'data', 'paypal.png' ); ok( -f $TEST_PNG, "Found test image: $TEST_PNG" ); my $TEST_PDF = catfile( 't', 'data', 'empty.pdf' ); ok( -f $TEST_PDF, "Found test pdf: $TEST_PDF" ); my $mail = Email::Stuffer->from('cpan@example.com' ) ->to ('santa@example.com') ->text_body("YAY") ->attach_file($TEST_GIF) ->attach(slurp($TEST_GIF)) ->attach_file($TEST_JPG) ->attach(slurp($TEST_JPG)) ->attach_file($TEST_PNG) ->attach(slurp($TEST_PNG)) ->attach_file($TEST_PDF) ->attach(slurp($TEST_PDF)) ->attach_file($TEST_PNG_UPPER) ->attach(slurp($TEST_PNG_UPPER)) ->email; is(0+$mail->parts, 11); like([$mail->parts]->[0]->content_type, qr(^text/plain)); like([$mail->parts]->[1]->content_type, qr(^image/gif)); like([$mail->parts]->[2]->content_type, qr(^image/gif)); like([$mail->parts]->[3]->content_type, qr(^image/jpeg)); like([$mail->parts]->[4]->content_type, qr(^image/jpeg)); like([$mail->parts]->[5]->content_type, qr(^image/png)); like([$mail->parts]->[6]->content_type, qr(^image/png)); like([$mail->parts]->[7]->content_type, qr(^application/pdf)); like([$mail->parts]->[8]->content_type, qr(^application/pdf)); like([$mail->parts]->[9]->content_type, qr(^image/png)); like([$mail->parts]->[10]->content_type, qr(^image/png)); sub slurp { my $fname = shift; open my $fh, '<', $fname or Carp::croak("Can't open '$fname' for reading: '$!'"); scalar(do { local $/; <$fh> }) } data000755000765000024 013677717700 14525 5ustar00rjbsstaff000000000000Email-Stuffer-0.018/tbody.html100644000765000024 6613677717700 16452 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t/data

Hello World!

empty.pdf100644000765000024 2102013677717700 16531 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t/data%PDF-1.4 %äüöß 2 0 obj <> stream x- 0slb~ZU\ ު)_(e`VC k;]6xQfo;cA&FYD6gݟԸȁצ.yH79()cg %bB/W"z endstream endobj 3 0 obj 134 endobj 4 0 obj <> /Length 25 /Filter/FlateDecode >> stream x+T0P0t..@.) endstream endobj 5 0 obj <> endobj 7 0 obj <> stream xY{P[י?\@@X a lE$Ca ۀ%ylhc 7nu8y74v3tMix4mtv7uu +a'ig;=w$b"(M ywǖdB?Ag'y~plhG? |R>}ڦRp$ J ;_3_}?|=m9>GF;""~!պxb%Xd͏!0'H #+t5\䗯F4&=wPm?Z[7_YQ,:wQOJCE@r OmFF_4 ]=}]=N-@;ݐwѻxz(2(AI:N0Ǩ8 ΢'p/ ' н@hh鑯W(mOЫ{Z me$׉@9J?sykM40$yΎ ׵m7M k(&CLNedLy(7"+S9m["0Hb1 6R#(jj6ӎm$ϡw$D53 .X\wY`4[;2`Bʼn0CaaŬ+e2[:%[jre`PIVb$YiZ PJWQ.ɡ & <y*E1Qgi>4-o#(D]B)/m9d)Ų_BSUU&joyeNES0+m ̢tӉ*;RD4v[;,m5D 'zo Irʪt! ޢҪ t6qAl@ ֐Xy#M);/_@SPps9TPsࡢE/+ ##h-炖2̉@GrRScչXP&dC)솛+6KueAM,ܒDyh "-)al'--`d ;ȽhlԊ[;*a3kۦ0JPcؿ{'Ct#=T~-T"La-Qmiz*OTIk4B:Q]pV"FκJj5_w!@)T|RH$r֬&ܰ뿞o!ΕWh6KjҲqvfg RL eeO*GP3JN/nz~TeO[aҝ]1%ݩ⤍ref5VX832M_:FYUvd:{Ξӷncӣ]ܗϦvf{Y5\qm33~c(~޷~zKϪ Ϯ _EoeP<ihTlGX-h׎#mAG?F2=>jzUCjLUOEZqKjF2Lfd~E )YW,1ޞ'3ڒj3}z੧WPQQ '9!ECT|߳WV/T_&jk5#.WyUnQ%WKșJH KҫL[Jd6|vF\ȬȭVQyWșHW-=Srz5:؏ZYS~FUo.+oV!9OHuV O g Nx;^.Ira0@G9/`e,wrVGGp$%׮$ý-0JpLAP%)XVo U y^8o RD͟'3I )(h&MX."d :aEjrX  @^qD*M`*i$ U\.Œ@= $lvhy\%l&5jHxJ 0F:EϖЩ eA6A/!ŬA„q0a0&L  I=; "$߬\lE甖}gV[u-;5$sX`.}}\mrW,KR 'ַw]Fns϶?EW o}|[mǓjGgj_t{r䒕zܝ붺u(e2VZs|hݪ,67[ WVTȗU&,W' Zw1҆ͮNY p;*@dAڝWݮUE5B:r-%lY(J::lXY̴'-5-utĽMߨs.-nZ .ŪhkZQi[kMV3dxcG^~ɱ+NkUȾ mZRe pag53]HGt:%bXc#yҲiJ&Wۆ耻o5-[VcHk-kY H/~b,[ՠ G+J~kiHWIiғe -E OC:|4sf iee*ߤVQ9&ʟ*TΔSqc= X .P*ڴ) W+ͺ þ邱[xaIӷ1 rc= Baޚ ]OysմUGv?~7偡rUFcgz{|R 离׭{3g:F>Q%:DDa{.{ԇՄQc%,DžkEj\\\\$lta^VԌ,sfݠG GMƢupӻM}r,5G,*΁la沭1&orXZ VGaɭmXk {3I]Uötнk`AŊlcnpw/S3L梴|30xhR-{MJ{݂9y%d? vL |BdX%?q~(Ÿ#j,z^d,j`VHAӴ~18  yf?(gZy\yL቞ǀURy|R8c@~?^OU|+"wyFG="O^itgZx:"9qÓM O?ȿʓO\|O܇%IA >gKxx|'̲JLK_NnXݲc(ra}kh,Y4V}*ssWŽoi;0lZ?3õQ(ɳ~nsJ<J(MΤU<k-#^:ql1sr.'+/,rn/(7 (J$k/vz}LM?r{9/#$ґZTEvB#^Ga(2flXerʳRhu*>A,ruԀH"z` hh,E3ȀL2y$EQz&E+)ZBgR pmNCYx}VC[́3(X߳ iOqLv&(qh-g<)Z6)Z#)Z)Z.3R Φ4T$(EQ\3Lk): ݣqtlw,:4J8We =2Éreپ \,#n]K}Mg \4΅D,<mFn‰E#CckHn)QQuC{_H#\‰H p7F#?Kx41 ޱ+DizGcc>HD#ÉJ;tS`s@$;;F.)"dss|#08ۓ6\<(|#XlH1ru&#C0%FhnCQ4Qq C.V@֏`QT +P?ۡh%_j֠N7 Ja$: Q4gRh;$I|R5$#RXVHyy$QeU}_B*Q ,:$IkHV_q#DZv$(éI H~ }C/1Tf7.\/ҜaC+q¹A`?됨`?K ylc0wZЈ4ivdmj6r/¡#K[껐}<'Y1xB#RtHc0 Jnf!$/f%TZ^z2O7> u s}Wq*'䏗L/\:sl>f*?ƚ ͲStG8]ߝ1Aׯwp]zJ3]3z;TΌL̜9?siF5ʡW?4i^6LL6|-8:N=5Op><~a:\lzHKG>!cL+.֭"ua7rj5Dܧ_c9Ƈ:;i|{ l񃢵=mEŃ"ڼ%8v=x5[EWGP [ <5NQCw<@7Qo<)D5q> endobj 10 0 obj <> stream x]n <b:L'1&S&.>ՒT ߾6]9p!u{ktjށÃT¬0J VŝO :;Z5DfgW "/VjĻu()*,`<1& ѵooKOyka,S# MS!P_/,?K)-sT>$.7χEsOcKkK!4!n0_#Co ~h\q}J endstream endobj 11 0 obj <> endobj 12 0 obj <> endobj 13 0 obj <> /ExtGState<> /ProcSet[/PDF/Text/ImageC/ImageI/ImageB] >> endobj 1 0 obj <>/Contents 2 0 R>> endobj 6 0 obj <> endobj 14 0 obj <> endobj 15 0 obj < /Producer /CreationDate(D:20150201134526+01'00')>> endobj xref 0 16 0000000000 65535 f 0000007683 00000 n 0000000019 00000 n 0000000224 00000 n 0000000244 00000 n 0000000440 00000 n 0000007826 00000 n 0000000480 00000 n 0000006759 00000 n 0000006780 00000 n 0000006975 00000 n 0000007319 00000 n 0000007525 00000 n 0000007558 00000 n 0000007925 00000 n 0000008022 00000 n trailer < <899083AA937AEF8628BDFBB8541C09EA> ] /DocChecksum /805CF7A38F6CECD8BE3DF76AEE2947E3 >> startxref 8197 %%EOF paypal.gif100644000765000024 1573513677717700 16675 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t/dataGIF89aX!ܡjt*^2eFs8byܫ5{ fff,X!pH,Ȥr\jШtJZlUxxL.h1nӍ{e m jlc~ g   `c   } eO bU ¿ڈ V Մ^Ptd⠚ W P Jc@9lZL2п'2!_v=1`Q+0TQR'+8RC|-i@Xm2ڬa'\*]C2VL*x#RQ PpQ4P'5B6@nLbáUd3 Rxaz bMH1l:0( txL{YEfH2w:x*]E$q)uy*6 BP?r)ge_/iVPEY%%:CABC"DRYDPETP$Z\sh-9?A((j'盰زT۞7r8ݸRFg=5H <@Ze(^4{9u7F9 5|3&.vÍtd%MѲ Q)bB40`@*Xjzu*O-#օ xʶ-թQ \I@ӧQ+"@Zk*U\uBju^_5-/NBp+cPQJ[7\WJ! ,/Nx^ʾ-zMHP$"`@"1EҢ جv˭67YqL Tun߮ @I4|ϯQ9dSTV\X~5MKw%6&6c<@@@QE#tQSz+hh`Eƒنy_ x8w#y'4 `bְ90RИPt6 f%.8x.Ezj>e7f) PFCuQ\ٱF1 PR :K  ,:.!pޡ@Š+,ٳajH`$  ݱ_. K (%FwkǑ fNCVҋΓ+Ȉz5 r8a"Zd{$)W!A!d,*'ziwiˊx ޸|[3(Ȥ~bZgJZX Җtr ~8b_9ޮOf; 7 " 8>m^;EED G ^E;N@Q< E6gN 8\n;oE4B<FN]857_׻8ފ  E<ٻ8EtdH&hD!@G @ 1!1W%22jȑCf$Aȓ(;<6$K$Mq8G:®ϟ>uyaAԅѢ$`LSJXF}ڔi! ,*dugjdQ!R`_p($Aht:tJZE4xL.YYR)+YV$M'K3IK#4$4v;;;KAkKyMsn)__ZAymyY l;"#%2 Zw _$׮ı_2F\pv0a>Z\' @e5l08O]g(Ue"" rS(}K($H"5ѢL!!CEjݚ(P@)׳JH Y}XqU+:h +%xx zu l@G'N 7ifXSeC! ,/pH1l:0( txL{YEfH2w:x*]E$q)uy*6 BP?r)ge_/iVPEY%%:CABC"DRYDPETP$Z\sh-9?A((j'盰زT۞7r8ݸRFg=5H <@Ze(^4{9u7F9 5|3&.vÍtd%MѲ Q)bB40`@*Xjzu*O-#օ xʶ-թQ \I@ӧQ+"@Zk*U\uBju^_5-/NBp+cPQJ[7\WJ! ,/'dih*"R+0laxnt pq|v$xH3Kn(ar0jlPq32z6|%~71k{mpsviduFyM>Vf,:Is-!! ,0'`Yz g,[d="R.\0B,b ȄRdhL$6p(#p r4q}GjQT:#&@ADyw`z|}~J1$9qsuyP XZA]xl4"`{ePJXtzL4q?\̲ kSTHIJ3m? .=pN:wƮz]g> 8)uJ(bxwz|~}S -.8t@DjRTXZ\#_aC{mo$8vlug"7t?u{ikU;+) `gDZ)==H)=0 ܼgB|" 4tϠ 'Gݙ\X 1qŻ8|V ^2Ph9z 2x:rjlً}VaH: /Llq׹_"uE#R7*#YvJ7 >$%lXq}@oܵ?o !d,+''PEJe%˖Rܷa`a8hdp7sE@*ef"4 nkPZ޴I {xmq#~XvI_ $9s?I 8W_#8}ZVW b7#h"A()1]018h' I "hP08Kb d'#8FjW,v] =I[w_ HKaZ,QT AGDS,RFDala,\NEVA&Mo K ;MLXAeR$FSzW BPNtYMDN.K! ,+'EQIYh0۶RsaX)MSAh2`$-BbBl Pkf 8@xFCyX];^sruwyxP 2"npAfOQU"[]@vikoh{}qzc,o 8)uJ(evZ/>z{n(ar?x3LQq3jN`};vi2|psfmuGMSW,IJ:Ҳ@!!,8 37 _i9FR,ir>8ۀ׳JA 8 KUFUJ !,0 n7 _i) aF`ے$d+ n E-=*8W7MshsƖ,XYdWuXx13o]hdU!!2,X!']ihl(omxrnȤrDv`JX'lx%@.\.B[Nfj3z;&xUWtrpnljhprtvP}%vZ_ll_YvwxÁYrnfšmnuWǀLɇ[]ajֵնds%~;rO:V`yg타nQ 7_)t(wrΪv%LNwqUb- їDLOYhI\s2 oޅuӔQ g kV*D\ĮL,[ :l;h]$l)^lniIPbuEy<ءͼm mKNس[QBK']e;paypal.jpg100644000765000024 416613677717700 16664 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t/dataJFIFHHC       C !X" = !1"A2QW#37Uqrtv*!1AQa"Rq ?Xc9xΙ3ZRdI88닊ڔMI'rNoۛ_YjoC3*-LJH_,'Z1qDf*me K~wC)ˎ_/#:{IKi$ o\/R6dReB&f UT8Hnt)}6•Ճٟw[]RэɒzŖBR\T)0+q֜.r@Y$ l]Deuۃn~R.T-;]!/. c `IPޥQ%$Dt@fV$ў.=⿲3?N4p;2^2Za)\] %Hܒ{~ dAny+ ҫȁE*!,>% *R~$ wgI]3&^Py*ٱbNaVlw}D'98sJ~$cqwB1_oՓiP:{i"dژO+-4L `PJvPnn5^Tܳ#8_ [])SnjFK1c0 Ki$C=R3CqjќZS8ِ%(W r^Q˜FoQVnlVOGf]\! BNBѺT|׆鶍tHZ&תqzjA%^¦ỏm-6$D3T8 [ˏb̻1}Wy]5j&Ժ AJoVXxLﺥ)u+1W%B\i-֤55.=n\x%4Zzo!)S+ ǚRv^dv'I3W)^aan6%G#`$n=FvI 48cj Ṁv?53%̋{А*m;>5|#1U~˜I#.o8쭊oakݸ;\&ܧSnB[mO%6mr)-ugҺmVd;"LU,SwKK ,'ZBo[;]bi e(HH)嶭&:`߿jΎ 7 jWejș2˱1& YN%ARVd~a!Ip=~ZU?8y[]e4+‘Hzo2JʞiRW*twױ T`Ԣ{#ҥ^U~&qϔ}읿QxD0>n*~OƱ{vA6>Z˕ȯĕsjCTkJRHnnWUp/YkviГW"B![x xb5xw0ks?׮YԗT>XqCbd^!Y8X^-C}8֠Gԓ*4WPWeS7T*mJ!C,LmūgNsᦲFIDATHVv0#kgO `__H)GFW:m(' 5զ4//\jMo[eذI|NUb|ta)gGѪF]7ĸs8 PCО6+1|,zBΤM}%{0b5jn{T1EXx,5rzTv٧ɪT^%I5M*q;&U=/IDATHVv0#kgO `__H)GFW:m(' 5զ4//\jMo[eذI|NUb|ta)gGѪF]7ĸs8 PCО6+1|,zBΤM}%{0b5jn{T1EXx,5rzTv٧ɪT^%I5M*q;&U=/from ('cpan@ali.as' ) #pod ->to ('santa@northpole.org' ) #pod ->bcc ('bunbun@sluggy.com' ) #pod ->text_body($body ) #pod ->attach_file('dead_bunbun_faked.gif' ) #pod ->send; #pod #pod =head1 DESCRIPTION #pod #pod B #pod #pod Email::Stuffer, as its name suggests, is a fairly casual module used #pod to stuff things into an email and send them. It is a high-level module #pod designed for ease of use when doing a very specific common task, but #pod implemented on top of the light and tolerable Email:: modules. #pod #pod Email::Stuffer is typically used to build emails and send them in a single #pod statement, as seen in the synopsis. And it is certain only for use when #pod creating and sending emails. As such, it contains no email parsing #pod capability, and little to no modification support. #pod #pod To re-iterate, this is very much a module for those "slap it together and #pod fire it off" situations, but that still has enough grunt behind the scenes #pod to do things properly. #pod #pod =head2 Default Transport #pod #pod Although it cannot be relied upon to work, the default behaviour is to #pod use C to send mail, if you don't provide the mail send channel #pod with either the C method, or as an argument to C. #pod #pod (Actually, the choice of default is delegated to #pod L, which makes its own choices. But usually, it #pod uses C.) #pod #pod =head2 Why use this? #pod #pod Why not just use L or L? After all, this just adds #pod another layer of stuff around those. Wouldn't using them directly be better? #pod #pod Certainly, if you know EXACTLY what you are doing. The docs are clear enough, #pod but you really do need to have an understanding of the structure of MIME #pod emails. This structure is going to be different depending on whether you have #pod text body, HTML, both, with or without an attachment etc. #pod #pod Then there's brevity... compare the following roughly equivalent code. #pod #pod First, the Email::Stuffer way. #pod #pod Email::Stuffer->to('Simon Cozens') #pod ->from('Santa@northpole.org') #pod ->text_body("You've been good this year. No coal for you.") #pod ->attach_file('choochoo.gif') #pod ->send; #pod #pod And now doing it directly with a knowledge of what your attachment is, and #pod what the correct MIME structure is. #pod #pod use Email::MIME; #pod use Email::Sender::Simple; #pod use IO::All; #pod #pod Email::Sender::Simple->try_to_send( #pod Email::MIME->create( #pod header => [ #pod To => 'simon@somewhere.jp', #pod From => 'santa@northpole.org', #pod ], #pod parts => [ #pod Email::MIME->create( #pod body => "You've been a good boy this year. No coal for you." #pod ), #pod Email::MIME->create( #pod body => io('choochoo.gif'), #pod attributes => { #pod filename => 'choochoo.gif', #pod content_type => 'image/gif', #pod }, #pod ), #pod ], #pod ); #pod ); #pod #pod Again, if you know MIME well, and have the patience to manually code up #pod the L structure, go do that, if you really want to. #pod #pod Email::Stuffer as the name suggests, solves one case and one case only: #pod generate some stuff, and email it to somewhere, as conveniently as #pod possible. DWIM, but do it as thinly as possible and use the solid #pod Email:: modules underneath. #pod #pod =head1 COOKBOOK #pod #pod Here is another example (maybe plural later) of how you can use #pod Email::Stuffer's brevity to your advantage. #pod #pod =head2 Custom Alerts #pod #pod package SMS::Alert; #pod use base 'Email::Stuffer'; #pod #pod sub new { #pod shift()->SUPER::new(@_) #pod ->from('monitor@my.website') #pod # Of course, we could have pulled these from #pod # $MyConfig->{support_tech} or something similar. #pod ->to('0416181595@sms.gateway') #pod ->transport('SMTP', { host => '123.123.123.123' }); #pod } #pod #pod Z<> #pod #pod package My::Code; #pod #pod unless ( $Server->restart ) { #pod # Notify the admin on call that a server went down and failed #pod # to restart. #pod SMS::Alert->subject("Server $Server failed to restart cleanly") #pod ->send; #pod } #pod #pod =head1 METHODS #pod #pod As you can see from the synopsis, all methods that B the #pod Email::Stuffer object returns the object, and thus most normal calls are #pod chainable. #pod #pod However, please note that C, and the group of methods that do not #pod change the Email::Stuffer object B return the object, and thus #pod B chainable. #pod #pod =cut use 5.005; use strict; use Carp qw(croak); use File::Basename (); use Params::Util 1.05 qw(_INSTANCE _INSTANCEDOES); use Email::MIME 1.943 (); use Email::MIME::Creator (); use Email::Sender::Simple (); use Module::Runtime qw(require_module); ##################################################################### # Constructor and Accessors #pod =method new #pod #pod Creates a new, empty, Email::Stuffer object. #pod #pod You can pass a hashref of properties to set, including: #pod #pod =for :list #pod * to #pod * from #pod * cc #pod * bcc #pod * reply_to #pod * subject #pod * text_body #pod * html_body #pod * transport #pod #pod The to, cc, bcc, and reply_to headers properties may be provided as array #pod references. The array's contents will be used as the list of arguments to the #pod setter. #pod #pod =cut my %IS_INIT_ARG = map {; $_ => 1 } qw( to from cc bcc reply_to subject text_body html_body transport ); my %IS_ARRAY_ARG = map {; $_ => 1 } qw( to cc bcc reply_to transport ); sub new { Carp::croak("new method called on Email::Stuffer instance") if ref $_[0]; my ($class, $arg) = @_; my $self = bless { parts => [], email => Email::MIME->create( header => [], parts => [], ), }, $class; my @init_args = keys %{ $arg || {} }; if (my @bogus = grep {; ! $IS_INIT_ARG{$_} } @init_args) { Carp::croak("illegal arguments to Email::Stuffer->new: @bogus"); } for my $init_arg (@init_args) { my @args = $arg->{$init_arg}; if ($IS_ARRAY_ARG{$init_arg} && ref $args[0] && ref $args[0] eq 'ARRAY') { @args = @{ $args[0] }; } $self->$init_arg(@args); } $self; } sub _self { my $either = shift; ref($either) ? $either : $either->new; } #pod =method header_names #pod #pod Returns, as a list, all of the headers currently set for the Email #pod For backwards compatibility, this method can also be called as B[headers]. #pod #pod =cut sub header_names { shift()->{email}->header_names; } sub headers { shift()->{email}->header_names; ## This is now header_names, headers is depreciated } #pod =method parts #pod #pod Returns, as a list, the L parts for the Email #pod #pod =cut sub parts { grep { defined $_ } @{shift()->{parts}}; } ##################################################################### # Header Methods #pod =method header $header => $value #pod #pod Sets a named header in the email. Multiple calls with the same $header #pod will overwrite previous calls $value. #pod #pod =cut sub header { my $self = shift()->_self; return unless @_; $self->{email}->header_str_set(ucfirst shift, shift); return $self; } #pod =method to @addresses #pod #pod Sets the To: header in the email #pod #pod =cut sub _assert_addr_list_ok { my ($self, $header, $allow_empty, $list) = @_; Carp::croak("$header is a required field") unless $allow_empty or @$list; for (@$list) { Carp::croak("list of $header headers contains undefined values") unless defined; Carp::croak("list of $header headers contains unblessed references") if ref && ! blessed $_; } } sub to { my $self = shift()->_self; $self->_assert_addr_list_ok(to => 0 => \@_); $self->{email}->header_str_set(To => (@_ > 1 ? \@_ : @_)); return $self; } #pod =method from $address #pod #pod Sets the From: header in the email #pod #pod =cut sub from { my $self = shift()->_self; $self->_assert_addr_list_ok(from => 0 => \@_); Carp::croak("only one address is allowed in the from header") if @_ > 1; $self->{email}->header_str_set(From => shift); return $self; } #pod =method reply_to $address #pod #pod Sets the Reply-To: header in the email #pod #pod =cut sub reply_to { my $self = shift()->_self; $self->_assert_addr_list_ok('reply-to' => 0 => \@_); Carp::croak("only one address is allowed in the reply-to header") if @_ > 1; $self->{email}->header_str_set('Reply-To' => shift); return $self; } #pod =method cc @addresses #pod #pod Sets the Cc: header in the email #pod #pod =cut sub cc { my $self = shift()->_self; $self->_assert_addr_list_ok(cc => 1 => \@_); $self->{email}->header_str_set(Cc => (@_ > 1 ? \@_ : @_)); return $self; } #pod =method bcc @addresses #pod #pod Sets the Bcc: header in the email #pod #pod =cut sub bcc { my $self = shift()->_self; $self->_assert_addr_list_ok(bcc => 1 => \@_); $self->{email}->header_str_set(Bcc => (@_ > 1 ? \@_ : @_)); return $self; } #pod =method subject $text #pod #pod Sets the Subject: header in the email #pod #pod =cut sub subject { my $self = shift()->_self; Carp::croak("subject is a required field") unless defined $_[0]; $self->{email}->header_str_set(Subject => shift); return $self; } ##################################################################### # Body and Attachments #pod =method text_body $body [, $attribute => $value, ... ] #pod #pod Sets the text body of the email. Appropriate headers are set for you. #pod You may override MIME attributes as needed. See the C #pod parameter to L for the headers you can set. #pod #pod If C<$body> is undefined, this method will do nothing. #pod #pod Prior to Email::Stuffer version 0.015 text body was marked as flowed, #pod which broke all pre-formated body text. Empty space at the beggining #pod of the line was dropped and every new line character could be changed #pod to one space (and vice versa). Version 0.015 (and later) does not set #pod flowed format automatically anymore and so text body is really plain #pod text. If you want to use old behavior of "advanced" flowed formatting, #pod set flowed format manually by: C<< text_body($body, format => 'flowed') >>. #pod #pod =cut sub text_body { my $self = shift()->_self; my $body = defined $_[0] ? shift : return $self; my %attr = ( # Defaults content_type => 'text/plain', charset => 'utf-8', encoding => 'quoted-printable', # Params overwrite them @_, ); # Create the part in the text slot $self->{parts}->[0] = Email::MIME->create( attributes => \%attr, body_str => $body, ); $self; } #pod =method html_body $body [, $header => $value, ... ] #pod #pod Sets the HTML body of the email. Appropriate headers are set for you. #pod You may override MIME attributes as needed. See the C #pod parameter to L for the headers you can set. #pod #pod If C<$body> is undefined, this method will do nothing. #pod #pod =cut sub html_body { my $self = shift()->_self; my $body = defined $_[0] ? shift : return $self; my %attr = ( # Defaults content_type => 'text/html', charset => 'utf-8', encoding => 'quoted-printable', # Params overwrite them @_, ); # Create the part in the HTML slot $self->{parts}->[1] = Email::MIME->create( attributes => \%attr, body_str => $body, ); $self; } #pod =method attach $contents [, $attribute => $value, ... ] #pod #pod Adds an attachment to the email. The first argument is the file contents #pod followed by (as for text_body and html_body) the list of headers to use. #pod Email::Stuffer will I to guess the headers correctly, but you may wish #pod to provide them anyway to be sure. Encoding is Base64 by default. See #pod the C parameter to L for the headers you #pod can set. #pod #pod =cut sub _detect_content_type { my ($filename, $body) = @_; if (defined($filename)) { if ($filename =~ /\.([a-zA-Z]{3,4})\z/) { my $content_type = { 'gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'txt' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html', 'css' => 'text/css', 'csv' => 'text/csv', 'pdf' => 'application/pdf', 'wav' => 'audio/wav', }->{lc($1)}; return $content_type if defined $content_type; } } if ($body =~ / \A(?: (GIF8) # gif | (\xff\xd8) # jpeg | (\x89PNG) # png | (%PDF-) # pdf ) /x) { return 'image/gif' if $1; return 'image/jpeg' if $2; return 'image/png' if $3; return 'application/pdf' if $4; } return 'application/octet-stream'; } sub attach { my $self = shift()->_self; my $body = defined $_[0] ? shift : return undef; my %attr = ( # Cheap defaults encoding => 'base64', # Params overwrite them @_, ); # The more expensive defaults if needed unless ( $attr{content_type} ) { $attr{content_type} = _detect_content_type($attr{filename}, $body); } ### MORE? # Determine the slot to put it at my $slot = scalar @{$self->{parts}}; $slot = 3 if $slot < 3; # Create the part in the attachment slot $self->{parts}->[$slot] = Email::MIME->create( attributes => \%attr, body => $body, ); $self; } #pod =method attach_file $file [, $attribute => $value, ... ] #pod #pod Attachs a file that already exists on the filesystem to the email. #pod C will attempt to auto-detect the MIME type, and use the #pod file's current name when attaching. See the C parameter to #pod L for the headers you can set. #pod #pod =cut sub attach_file { my $self = shift; my $body_arg = shift; my $name = undef; my $body = undef; # Support IO::All::File arguments if ( Params::Util::_INSTANCE($body_arg, 'IO::All::File') ) { $body_arg->binmode; $name = $body_arg->name; $body = $body_arg->all; # Support file names } elsif ( defined $body_arg and Params::Util::_STRING($body_arg) ) { croak "No such file '$body_arg'" unless -f $body_arg; $name = $body_arg; $body = _slurp( $body_arg ); # That's it } else { my $type = ref($body_arg) || "<$body_arg>"; croak "Expected a file name or an IO::All::File derivative, got $type"; } # Clean the file name $name = File::Basename::basename($name); croak("basename somehow returned undef") unless defined $name; # Now attach as normal $self->attach( $body, name => $name, filename => $name, @_ ); } # Provide a simple _slurp implementation sub _slurp { my $file = shift; local $/ = undef; open my $slurp, '<:raw', $file or croak("error opening $file: $!"); my $source = <$slurp>; close( $slurp ) or croak "error after slurping $file: $!"; \$source; } #pod =method transport #pod #pod $stuffer->transport( $moniker, @options ) #pod #pod or #pod #pod $stuffer->transport( $transport_obj ) #pod #pod The C method specifies the L transport that #pod you want to use to send the email, and any options that need to be #pod used to instantiate the transport. C<$moniker> is used as the transport #pod name; if it starts with an equals sign (C<=>) then the text after the #pod sign is used as the class. Otherwise, the text is prepended by #pod C. #pod #pod Alternatively, you can pass a complete transport object (which must be #pod an L object) and it will be used as is. #pod #pod =cut sub transport { my $self = shift()->_self; if ( @_ ) { # Change the transport if ( _INSTANCEDOES($_[0], 'Email::Sender::Transport') ) { $self->{transport} = shift; } else { my ($moniker, @arg) = @_; my $class = $moniker =~ s/\A=// ? $moniker : "Email::Sender::Transport::$moniker"; require_module($class); my $transport = $class->new(@arg); $self->{transport} = $transport; } } $self; } ##################################################################### # Output Methods #pod =method email #pod #pod Creates and returns the full L object for the email. #pod #pod =cut sub email { my $self = shift; my @parts = $self->parts; ### Lyle Hopkins, code added to Fix single part, and multipart/alternative ### problems if (scalar(@{ $self->{parts} }) >= 3) { ## multipart/mixed $self->{email}->parts_set(\@parts); } elsif (scalar(@{ $self->{parts} })) { ## Check we actually have any parts if ( _INSTANCE($parts[0], 'Email::MIME') && _INSTANCE($parts[1], 'Email::MIME') ) { ## multipart/alternate $self->{email}->header_set('Content-Type' => 'multipart/alternative'); $self->{email}->parts_set(\@parts); } elsif (_INSTANCE($parts[0], 'Email::MIME')) { ## As @parts is $self->parts without the blanks, we only need check ## $parts[0] ## single part text/plain _transfer_headers($self->{email}, $parts[0]); $self->{email} = $parts[0]; } } $self->{email}; } # Support coercion to an Email::MIME sub __as_Email_MIME { shift()->email } # Quick any routine sub _any (&@) { my $f = shift; return if ! @_; for (@_) { return 1 if $f->(); } return 0; } # header transfer from one object to another sub _transfer_headers { # $_[0] = from, $_[1] = to my @headers_move = $_[0]->header_names; my @headers_skip = $_[1]->header_names; foreach my $header_name (@headers_move) { next if _any { $_ eq $header_name } @headers_skip; my @values = $_[0]->header($header_name); $_[1]->header_str_set( $header_name, @values ); } } #pod =method as_string #pod #pod Returns the string form of the email. Identical to (and uses behind the #pod scenes) Email::MIME-Eas_string. #pod #pod =cut sub as_string { shift()->email->as_string; } #pod =method send #pod #pod $stuffer->send; #pod #pod or #pod #pod $stuffer->send({ to => [ $to_1, $to_2 ], from => $sender }); #pod #pod Sends the email via L. #pod L #pod can be specified in a hash reference. #pod #pod On failure, returns false. #pod #pod =cut sub send { my $self = shift; my $arg = shift; my $email = $self->email or return undef; my $transport = $self->{transport}; Email::Sender::Simple->try_to_send( $email, { ($transport ? (transport => $transport) : ()), $arg ? %$arg : (), }, ); } #pod =method send_or_die #pod #pod $stuffer->send_or_die; #pod #pod or #pod #pod $stuffer->send_or_die({ to => [ $to_1, $to_2 ], from => $sender }); #pod #pod Sends the email via L. #pod L #pod can be specified in a hash reference. #pod #pod On failure, throws an exception. #pod #pod =cut sub send_or_die { my $self = shift; my $arg = shift; my $email = $self->email or return undef; my $transport = $self->{transport}; Email::Sender::Simple->send( $email, { ($transport ? (transport => $transport) : ()), $arg ? %$arg : (), }, ); } 1; #pod =head1 TO DO #pod #pod =for :list #pod * Fix a number of bugs still likely to exist #pod * Write more tests. #pod * Add any additional small bit of automation that isn't too expensive #pod #pod =head1 SEE ALSO #pod #pod L, L, L #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Stuffer - A more casual approach to creating and sending Email:: emails =head1 VERSION version 0.018 =head1 SYNOPSIS # Prepare the message my $body = <<'AMBUSH_READY'; Dear Santa I have killed Bun Bun. Yes, I know what you are thinking... but it was actually a total accident. I was in a crowded line at a BayWatch signing, and I tripped, and stood on his head. I know. Oops! :/ So anyways, I am willing to sell you the body for $1 million dollars. Be near the pinhole to the Dimension of Pain at midnight. Alias AMBUSH_READY # Create and send the email in one shot Email::Stuffer->from ('cpan@ali.as' ) ->to ('santa@northpole.org' ) ->bcc ('bunbun@sluggy.com' ) ->text_body($body ) ->attach_file('dead_bunbun_faked.gif' ) ->send; =head1 DESCRIPTION B Email::Stuffer, as its name suggests, is a fairly casual module used to stuff things into an email and send them. It is a high-level module designed for ease of use when doing a very specific common task, but implemented on top of the light and tolerable Email:: modules. Email::Stuffer is typically used to build emails and send them in a single statement, as seen in the synopsis. And it is certain only for use when creating and sending emails. As such, it contains no email parsing capability, and little to no modification support. To re-iterate, this is very much a module for those "slap it together and fire it off" situations, but that still has enough grunt behind the scenes to do things properly. =head2 Default Transport Although it cannot be relied upon to work, the default behaviour is to use C to send mail, if you don't provide the mail send channel with either the C method, or as an argument to C. (Actually, the choice of default is delegated to L, which makes its own choices. But usually, it uses C.) =head2 Why use this? Why not just use L or L? After all, this just adds another layer of stuff around those. Wouldn't using them directly be better? Certainly, if you know EXACTLY what you are doing. The docs are clear enough, but you really do need to have an understanding of the structure of MIME emails. This structure is going to be different depending on whether you have text body, HTML, both, with or without an attachment etc. Then there's brevity... compare the following roughly equivalent code. First, the Email::Stuffer way. Email::Stuffer->to('Simon Cozens') ->from('Santa@northpole.org') ->text_body("You've been good this year. No coal for you.") ->attach_file('choochoo.gif') ->send; And now doing it directly with a knowledge of what your attachment is, and what the correct MIME structure is. use Email::MIME; use Email::Sender::Simple; use IO::All; Email::Sender::Simple->try_to_send( Email::MIME->create( header => [ To => 'simon@somewhere.jp', From => 'santa@northpole.org', ], parts => [ Email::MIME->create( body => "You've been a good boy this year. No coal for you." ), Email::MIME->create( body => io('choochoo.gif'), attributes => { filename => 'choochoo.gif', content_type => 'image/gif', }, ), ], ); ); Again, if you know MIME well, and have the patience to manually code up the L structure, go do that, if you really want to. Email::Stuffer as the name suggests, solves one case and one case only: generate some stuff, and email it to somewhere, as conveniently as possible. DWIM, but do it as thinly as possible and use the solid Email:: modules underneath. =head1 METHODS As you can see from the synopsis, all methods that B the Email::Stuffer object returns the object, and thus most normal calls are chainable. However, please note that C, and the group of methods that do not change the Email::Stuffer object B return the object, and thus B chainable. =head2 new Creates a new, empty, Email::Stuffer object. You can pass a hashref of properties to set, including: =over 4 =item * to =item * from =item * cc =item * bcc =item * reply_to =item * subject =item * text_body =item * html_body =item * transport =back The to, cc, bcc, and reply_to headers properties may be provided as array references. The array's contents will be used as the list of arguments to the setter. =head2 header_names Returns, as a list, all of the headers currently set for the Email For backwards compatibility, this method can also be called as B[headers]. =head2 parts Returns, as a list, the L parts for the Email =head2 header $header => $value Sets a named header in the email. Multiple calls with the same $header will overwrite previous calls $value. =head2 to @addresses Sets the To: header in the email =head2 from $address Sets the From: header in the email =head2 reply_to $address Sets the Reply-To: header in the email =head2 cc @addresses Sets the Cc: header in the email =head2 bcc @addresses Sets the Bcc: header in the email =head2 subject $text Sets the Subject: header in the email =head2 text_body $body [, $attribute => $value, ... ] Sets the text body of the email. Appropriate headers are set for you. You may override MIME attributes as needed. See the C parameter to L for the headers you can set. If C<$body> is undefined, this method will do nothing. Prior to Email::Stuffer version 0.015 text body was marked as flowed, which broke all pre-formated body text. Empty space at the beggining of the line was dropped and every new line character could be changed to one space (and vice versa). Version 0.015 (and later) does not set flowed format automatically anymore and so text body is really plain text. If you want to use old behavior of "advanced" flowed formatting, set flowed format manually by: C<< text_body($body, format => 'flowed') >>. =head2 html_body $body [, $header => $value, ... ] Sets the HTML body of the email. Appropriate headers are set for you. You may override MIME attributes as needed. See the C parameter to L for the headers you can set. If C<$body> is undefined, this method will do nothing. =head2 attach $contents [, $attribute => $value, ... ] Adds an attachment to the email. The first argument is the file contents followed by (as for text_body and html_body) the list of headers to use. Email::Stuffer will I to guess the headers correctly, but you may wish to provide them anyway to be sure. Encoding is Base64 by default. See the C parameter to L for the headers you can set. =head2 attach_file $file [, $attribute => $value, ... ] Attachs a file that already exists on the filesystem to the email. C will attempt to auto-detect the MIME type, and use the file's current name when attaching. See the C parameter to L for the headers you can set. =head2 transport $stuffer->transport( $moniker, @options ) or $stuffer->transport( $transport_obj ) The C method specifies the L transport that you want to use to send the email, and any options that need to be used to instantiate the transport. C<$moniker> is used as the transport name; if it starts with an equals sign (C<=>) then the text after the sign is used as the class. Otherwise, the text is prepended by C. Alternatively, you can pass a complete transport object (which must be an L object) and it will be used as is. =head2 email Creates and returns the full L object for the email. =head2 as_string Returns the string form of the email. Identical to (and uses behind the scenes) Email::MIME-Eas_string. =head2 send $stuffer->send; or $stuffer->send({ to => [ $to_1, $to_2 ], from => $sender }); Sends the email via L. L can be specified in a hash reference. On failure, returns false. =head2 send_or_die $stuffer->send_or_die; or $stuffer->send_or_die({ to => [ $to_1, $to_2 ], from => $sender }); Sends the email via L. L can be specified in a hash reference. On failure, throws an exception. =head1 COOKBOOK Here is another example (maybe plural later) of how you can use Email::Stuffer's brevity to your advantage. =head2 Custom Alerts package SMS::Alert; use base 'Email::Stuffer'; sub new { shift()->SUPER::new(@_) ->from('monitor@my.website') # Of course, we could have pulled these from # $MyConfig->{support_tech} or something similar. ->to('0416181595@sms.gateway') ->transport('SMTP', { host => '123.123.123.123' }); } Z<> package My::Code; unless ( $Server->restart ) { # Notify the admin on call that a server went down and failed # to restart. SMS::Alert->subject("Server $Server failed to restart cleanly") ->send; } =head1 TO DO =over 4 =item * Fix a number of bugs still likely to exist =item * Write more tests. =item * Add any additional small bit of automation that isn't too expensive =back =head1 SEE ALSO L, L, L =head1 AUTHORS =over 4 =item * Adam Kennedy =item * Ricardo SIGNES =back =head1 CONTRIBUTORS =for stopwords Aaron W. Swenson adam adamk@cpan.org adam@phase-n.com Alastair Douglas Aristotle Pagaltzis Arthur Axel 'fREW' Schmidt Chase Whitener CosmicNet Dan Book John Napiorkowski Josh Stompro Kevin Tew Kieren Diment Kris Matthews Lee Johnson Manni Heumann Pali Ricardo Signes Ross Attrill Russell Jenkins Shawn Sorichetti Steve Dondley tokuhirom =over 4 =item * Aaron W. Swenson =item * adam =item * adamk@cpan.org =item * adam@phase-n.com =item * Alastair Douglas =item * Aristotle Pagaltzis =item * Arthur Axel 'fREW' Schmidt =item * Chase Whitener =item * CosmicNet =item * Dan Book =item * John Napiorkowski =item * Josh Stompro =item * Kevin Tew =item * Kieren Diment =item * Kris Matthews =item * Kris Matthews =item * Lee Johnson =item * Manni Heumann =item * Pali =item * Ricardo Signes =item * Ross Attrill =item * Russell Jenkins =item * Shawn Sorichetti =item * Steve Dondley =item * tokuhirom =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Adam Kennedy and Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut set-empty-subject.t100644000765000024 153513677717700 17531 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl -w use strict; use warnings; use Test::More; use Email::Stuffer; # Verify subject() always returns $self my $stuffer = Email::Stuffer->new; is($stuffer->subject('Subject goes here'), $stuffer, 'subject returned $self'); # verify subject header added like( $stuffer->as_string, qr/^Subject:\sSubject\sgoes\shere\x0d?\x0a/mx, 'matching subject header', ); is($stuffer->subject(q{}), $stuffer, 'subject(q{}) returned $self'); is($stuffer->subject('Subject goes here'), $stuffer, 'subject returned $self'); like( $stuffer->as_string, qr/^Subject:\sSubject\sgoes\shere\x0d?\x0a/mx, 'matching subject header', ); is($stuffer->header(Subject => q{}), $stuffer, 'header(subject =>q{}) -> $self'); like( $stuffer->as_string, qr/^Subject:\s\x0d?\x0a/mx, 'matching subject header', ); #print $stuffer->as_string; done_testing(); 00-report-prereqs.t100644000765000024 1342613677717700 17376 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: author000755000765000024 013677717700 15306 5ustar00rjbsstaff000000000000Email-Stuffer-0.018/xtpod-syntax.t100644000765000024 25213677717700 17720 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); 00-report-prereqs.dd100644000765000024 400513677717700 17473 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/tdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Encode' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Email::MIME' => '1.943', 'Email::MIME::Creator' => '0', 'Email::Sender::Simple' => '0', 'File::Basename' => '0', 'Module::Runtime' => '0', 'Params::Util' => '1.05', 'Scalar::Util' => '0', 'perl' => '5.005', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Email::Sender::Transport::Test' => '0.120000', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'File::Spec::Functions' => '0', 'Moo' => '0', 'Test::Fatal' => '0', 'Test::More' => '0.96', 'utf8' => '0' } } }; $x; }header_to_or_replace.t100644000765000024 136013677717700 20266 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/t#!/usr/bin/perl -w use strict; use warnings; use Test::More; use Email::Stuffer; # verify that calling Email::Stuffer->header # actually replaces said header, rather than adds # a new one. my $stuffer = Email::Stuffer->new; $stuffer->header(to => 'foo@bar.net'); # verify to header added like( $stuffer->as_string, qr/^To:\sfoo\@bar\.net\x0d?\x0a/mx, 'matching to header', ); $stuffer->header(to => 'somewhere@else.net'); # verify old to header gone unlike( $stuffer->as_string, qr/^To:\sfoo\@bar\.net\x0d?\x0a/mx, 'old to header no longer present', ); # verify new to header present like( $stuffer->as_string, qr/^To:\ssomewhere\@else\.net\x0d?\x0a/mx, 'new to header present', ); #print $stuffer->as_string; done_testing(); release000755000765000024 013677717700 15424 5ustar00rjbsstaff000000000000Email-Stuffer-0.018/xtchanges_has_content.t100644000765000024 210113677717700 21740 0ustar00rjbsstaff000000000000Email-Stuffer-0.018/xt/releaseuse Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.018'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; }