create-berna-stencil 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eleventy.js +3 -1
- package/.env.example +8 -0
- package/.gitignore +2 -1
- package/README.md +1 -5
- package/bin/create.js +2 -1
- package/package.json +71 -70
- package/src/.htaccess +18 -0
- package/src/api/.htaccess +12 -0
- package/src/api/composer.json +6 -0
- package/src/api/composer.lock +574 -0
- package/src/api/endpoints/protected/secret.php +16 -0
- package/src/api/endpoints/protected/send-mail.php +75 -0
- package/src/api/endpoints/public/ping.php +16 -0
- package/src/api/index.php +95 -0
- package/src/api/init.php +43 -0
- package/src/api/modules/Response.php +37 -0
- package/src/api/vendor/autoload.php +22 -0
- package/src/api/vendor/composer/ClassLoader.php +579 -0
- package/src/api/vendor/composer/InstalledVersions.php +396 -0
- package/src/api/vendor/composer/LICENSE +21 -0
- package/src/api/vendor/composer/autoload_classmap.php +15 -0
- package/src/api/vendor/composer/autoload_files.php +12 -0
- package/src/api/vendor/composer/autoload_namespaces.php +9 -0
- package/src/api/vendor/composer/autoload_psr4.php +16 -0
- package/src/api/vendor/composer/autoload_real.php +50 -0
- package/src/api/vendor/composer/autoload_static.php +86 -0
- package/src/api/vendor/composer/installed.json +582 -0
- package/src/api/vendor/composer/installed.php +86 -0
- package/src/api/vendor/composer/platform_check.php +25 -0
- package/src/api/vendor/graham-campbell/result-type/.gitattributes +9 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +31 -0
- package/src/api/vendor/graham-campbell/result-type/.github/FUNDING.yml +2 -0
- package/src/api/vendor/graham-campbell/result-type/.github/SECURITY.md +14 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/stale.yml +11 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/graham-campbell/result-type/CHANGELOG.md +53 -0
- package/src/api/vendor/graham-campbell/result-type/LICENSE +21 -0
- package/src/api/vendor/graham-campbell/result-type/README.md +42 -0
- package/src/api/vendor/graham-campbell/result-type/composer.json +33 -0
- package/src/api/vendor/graham-campbell/result-type/phpunit.xml.dist +13 -0
- package/src/api/vendor/graham-campbell/result-type/src/Error.php +121 -0
- package/src/api/vendor/graham-campbell/result-type/src/Result.php +69 -0
- package/src/api/vendor/graham-campbell/result-type/src/Success.php +120 -0
- package/src/api/vendor/graham-campbell/result-type/tests/ResultTest.php +95 -0
- package/src/api/vendor/phpmailer/phpmailer/.codecov.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.editorconfig +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.gitattributes +17 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/FUNDING.yml +6 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/Dockerfile +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/entrypoint.sh +5 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/dependabot.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/docs.yaml +30 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/scorecards.yml +61 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/tests.yml +237 -0
- package/src/api/vendor/phpmailer/phpmailer/.phan/config.php +41 -0
- package/src/api/vendor/phpmailer/phpmailer/COMMITMENT +46 -0
- package/src/api/vendor/phpmailer/phpmailer/LICENSE +502 -0
- package/src/api/vendor/phpmailer/phpmailer/README.md +232 -0
- package/src/api/vendor/phpmailer/phpmailer/SECURITY.md +37 -0
- package/src/api/vendor/phpmailer/phpmailer/SMTPUTF8.md +48 -0
- package/src/api/vendor/phpmailer/phpmailer/UPGRADING.md +125 -0
- package/src/api/vendor/phpmailer/phpmailer/VERSION +1 -0
- package/src/api/vendor/phpmailer/phpmailer/changelog.md +1122 -0
- package/src/api/vendor/phpmailer/phpmailer/composer.json +84 -0
- package/src/api/vendor/phpmailer/phpmailer/docs/README.md +9 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps +46 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/README.md +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/azure_xoauth2.phps +126 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/callback.phps +76 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps +146 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform.phps +95 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contents.html +17 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contentsutf8.html +23 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/exceptions.phps +40 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/extending.phps +72 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail.phps +106 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps +121 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg +209 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mail.phps +35 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mailing_list.phps +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendmail.phps +37 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendoauth2.phps +100 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps +102 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps +99 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp.phps +62 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_check.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps +117 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps +53 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/ssl_options.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/get_oauth_token.php +182 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +26 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +39 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +31 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +29 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/phpcs.xml.dist +52 -0
- package/src/api/vendor/phpmailer/phpmailer/phpdoc.dist.xml +20 -0
- package/src/api/vendor/phpmailer/phpmailer/phpunit.xml.dist +36 -0
- package/src/api/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +245 -0
- package/src/api/vendor/phpmailer/phpmailer/src/Exception.php +40 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuth.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +44 -0
- package/src/api/vendor/phpmailer/phpmailer/src/PHPMailer.php +5525 -0
- package/src/api/vendor/phpmailer/phpmailer/src/POP3.php +470 -0
- package/src/api/vendor/phpmailer/phpmailer/src/SMTP.php +1617 -0
- package/src/api/vendor/phpmailer/phpmailer/test/DebugLogTestListener.php +47 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/accessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/inaccessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-fr.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-nl.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xa_scri_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xb_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xc_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xe.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xx.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yy.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-zz.php +20 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Language/TranslationCompletenessTest.php +97 -0
- package/src/api/vendor/phpmailer/phpmailer/test/OAuth/OAuthTest.php +76 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddEmbeddedImageTest.php +178 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringAttachmentTest.php +147 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringEmbeddedImageTest.php +161 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddrFormatTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AuthCRAMMD5Test.php +48 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/CustomHeaderTest.php +285 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMTest.php +258 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMWithoutExceptionsTest.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DSNConfiguratorTest.php +221 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeQTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeStringTest.php +135 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FileIsAccessibleTest.php +103 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FilenameToTypeTest.php +74 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GenerateIdTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GetLastMessageIDTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/HasLineLongerThanMaxTest.php +158 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Html2TextTest.php +231 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ICalTest.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsPermittedPathTest.php +108 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsValidHostTest.php +107 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/LocalizationTest.php +505 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MailTransportTest.php +261 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MbPathinfoTest.php +171 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MimeTypesTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/NormalizeBreaksTest.php +111 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PHPMailerTest.php +1388 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ParseAddressesTest.php +321 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PunyencodeAddressTest.php +141 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/QuotedStringTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ReplyToGetSetClearTest.php +444 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetErrorTest.php +154 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetFromTest.php +202 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetTest.php +81 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetWordWrapTest.php +120 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Utf8CharBoundaryTest.php +66 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressCustomValidatorTest.php +116 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressTest.php +485 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/WrapTextTest.php +125 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/XMailerTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/POP3/PopBeforeSmtpTest.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PreSendTestCase.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Security/DenialOfServiceVectorsTest.php +52 -0
- package/src/api/vendor/phpmailer/phpmailer/test/SendTestCase.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/TestCase.php +392 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakepopserver.sh +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakesendmail.sh +22 -0
- package/src/api/vendor/phpmailer/phpmailer/test/runfakepopserver.sh +12 -0
- package/src/api/vendor/phpmailer/phpmailer/test/testbootstrap-dist.php +8 -0
- package/src/api/vendor/phpmailer/phpmailer/test/validators.php +12 -0
- package/src/api/vendor/phpoption/phpoption/.gitattributes +13 -0
- package/src/api/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/phpoption/phpoption/.github/FUNDING.yml +2 -0
- package/src/api/vendor/phpoption/phpoption/.github/SECURITY.md +14 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/static.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/LICENSE +201 -0
- package/src/api/vendor/phpoption/phpoption/Makefile +17 -0
- package/src/api/vendor/phpoption/phpoption/README.md +201 -0
- package/src/api/vendor/phpoption/phpoption/composer.json +50 -0
- package/src/api/vendor/phpoption/phpoption/phpstan-baseline.neon +44 -0
- package/src/api/vendor/phpoption/phpoption/phpstan.neon.dist +7 -0
- package/src/api/vendor/phpoption/phpoption/phpunit.xml.dist +13 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +72 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +357 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +153 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +166 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +194 -0
- package/src/api/vendor/phpoption/phpoption/tests/bootstrap.php +8 -0
- package/src/api/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +8 -0
- package/src/api/vendor/symfony/polyfill-ctype/Ctype.php +232 -0
- package/src/api/vendor/symfony/polyfill-ctype/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-ctype/README.md +12 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap.php +50 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -0
- package/src/api/vendor/symfony/polyfill-ctype/composer.json +38 -0
- package/src/api/vendor/symfony/polyfill-mbstring/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -0
- package/src/api/vendor/symfony/polyfill-mbstring/README.md +13 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -0
- package/src/api/vendor/symfony/polyfill-mbstring/composer.json +39 -0
- package/src/api/vendor/symfony/polyfill-php80/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-php80/Php80.php +115 -0
- package/src/api/vendor/symfony/polyfill-php80/PhpToken.php +106 -0
- package/src/api/vendor/symfony/polyfill-php80/README.md +25 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/bootstrap.php +42 -0
- package/src/api/vendor/symfony/polyfill-php80/composer.json +37 -0
- package/src/api/vendor/vlucas/phpdotenv/.editorconfig +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.gitattributes +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/FUNDING.yml +2 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/SECURITY.md +14 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/static.yml +40 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +70 -0
- package/src/api/vendor/vlucas/phpdotenv/LICENSE +30 -0
- package/src/api/vendor/vlucas/phpdotenv/Makefile +17 -0
- package/src/api/vendor/vlucas/phpdotenv/README.md +370 -0
- package/src/api/vendor/vlucas/phpdotenv/UPGRADING.md +196 -0
- package/src/api/vendor/vlucas/phpdotenv/composer.json +60 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan-baseline.neon +157 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan.neon.dist +7 -0
- package/src/api/vendor/vlucas/phpdotenv/phpunit.xml.dist +13 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Validator.php +207 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +387 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +86 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +234 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +40 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +98 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +57 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +52 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +305 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +479 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +5 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +18 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +33 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +7 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +17 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +14 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +4 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +11 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +8 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +15 -0
- package/src/api/configExample.php +0 -28
- package/src/api/sendEmail.php +0 -131
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This example shows how to handle a simple contact form safely.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//Import PHPMailer class into the global namespace
|
|
8
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
9
|
+
|
|
10
|
+
$msg = '';
|
|
11
|
+
//Don't run this unless we're handling a form submission
|
|
12
|
+
if (array_key_exists('email', $_POST)) {
|
|
13
|
+
date_default_timezone_set('Etc/UTC');
|
|
14
|
+
|
|
15
|
+
require '../vendor/autoload.php';
|
|
16
|
+
|
|
17
|
+
//Create a new PHPMailer instance
|
|
18
|
+
$mail = new PHPMailer();
|
|
19
|
+
//Send using SMTP to localhost (faster and safer than using mail()) – requires a local mail server
|
|
20
|
+
//See other examples for how to use a remote server such as gmail
|
|
21
|
+
$mail->isSMTP();
|
|
22
|
+
$mail->Host = 'localhost';
|
|
23
|
+
$mail->Port = 25;
|
|
24
|
+
|
|
25
|
+
//Use a fixed address in your own domain as the from address
|
|
26
|
+
//**DO NOT** use the submitter's address here as it will be forgery
|
|
27
|
+
//and will cause your messages to fail SPF checks
|
|
28
|
+
$mail->setFrom('from@example.com', 'First Last');
|
|
29
|
+
//Choose who the message should be sent to
|
|
30
|
+
//You don't have to use a <select> like in this example, you can simply use a fixed address
|
|
31
|
+
//the important thing is *not* to trust an email address submitted from the form directly,
|
|
32
|
+
//as an attacker can substitute their own and try to use your form to send spam
|
|
33
|
+
$addresses = [
|
|
34
|
+
'sales' => 'sales@example.com',
|
|
35
|
+
'support' => 'support@example.com',
|
|
36
|
+
'accounts' => 'accounts@example.com',
|
|
37
|
+
];
|
|
38
|
+
//Validate address selection before trying to use it
|
|
39
|
+
if (array_key_exists('dept', $_POST) && array_key_exists($_POST['dept'], $addresses)) {
|
|
40
|
+
$mail->addAddress($addresses[$_POST['dept']]);
|
|
41
|
+
} else {
|
|
42
|
+
//Fall back to a fixed address if dept selection is invalid or missing
|
|
43
|
+
$mail->addAddress('support@example.com');
|
|
44
|
+
}
|
|
45
|
+
//Put the submitter's address in a reply-to header
|
|
46
|
+
//This will fail if the address provided is invalid,
|
|
47
|
+
//in which case we should ignore the whole request
|
|
48
|
+
if ($mail->addReplyTo($_POST['email'], $_POST['name'])) {
|
|
49
|
+
$mail->Subject = 'PHPMailer contact form';
|
|
50
|
+
//Keep it simple - don't use HTML
|
|
51
|
+
$mail->isHTML(false);
|
|
52
|
+
//Build a simple message body
|
|
53
|
+
$mail->Body = <<<EOT
|
|
54
|
+
Email: {$_POST['email']}
|
|
55
|
+
Name: {$_POST['name']}
|
|
56
|
+
Message: {$_POST['message']}
|
|
57
|
+
EOT;
|
|
58
|
+
//Send the message, check for errors
|
|
59
|
+
if (!$mail->send()) {
|
|
60
|
+
//The reason for failing to send will be in $mail->ErrorInfo
|
|
61
|
+
//but it's unsafe to display errors directly to users - process the error, log it on your server.
|
|
62
|
+
$msg = 'Sorry, something went wrong. Please try again later.';
|
|
63
|
+
} else {
|
|
64
|
+
$msg = 'Message sent! Thanks for contacting us.';
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
$msg = 'Invalid email address, message ignored.';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
?>
|
|
71
|
+
<!DOCTYPE html>
|
|
72
|
+
<html lang="en">
|
|
73
|
+
<head>
|
|
74
|
+
<meta charset="UTF-8">
|
|
75
|
+
<title>Contact form</title>
|
|
76
|
+
</head>
|
|
77
|
+
<body>
|
|
78
|
+
<h1>Contact us</h1>
|
|
79
|
+
<?php if (!empty($msg)) {
|
|
80
|
+
echo "<h2>$msg</h2>";
|
|
81
|
+
} ?>
|
|
82
|
+
<form method="POST">
|
|
83
|
+
<label for="name">Name: <input type="text" name="name" id="name"></label><br>
|
|
84
|
+
<label for="email">Email address: <input type="email" name="email" id="email"></label><br>
|
|
85
|
+
<label for="message">Message: <textarea name="message" id="message" rows="8" cols="20"></textarea></label><br>
|
|
86
|
+
<label for="dept">Send query to department:</label>
|
|
87
|
+
<select name="dept" id="dept">
|
|
88
|
+
<option value="sales">Sales</option>
|
|
89
|
+
<option value="support" selected>Technical support</option>
|
|
90
|
+
<option value="accounts">Accounts</option>
|
|
91
|
+
</select><br>
|
|
92
|
+
<input type="submit" value="Send">
|
|
93
|
+
</form>
|
|
94
|
+
</body>
|
|
95
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
5
|
+
<title>PHPMailer Test</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
|
|
9
|
+
<h1>This is a test of PHPMailer.</h1>
|
|
10
|
+
<div align="center">
|
|
11
|
+
<a href="https://github.com/PHPMailer/PHPMailer/"><img src="images/phpmailer.png" height="90" width="340" alt="PHPMailer rocks"></a>
|
|
12
|
+
</div>
|
|
13
|
+
<p>This example uses <strong>HTML</strong>.</p>
|
|
14
|
+
<p>ISO-8859-1 text: ���������</p>
|
|
15
|
+
</div>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
5
|
+
<title>PHPMailer Test</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
|
|
9
|
+
<h1>This is a test of PHPMailer.</h1>
|
|
10
|
+
<div align="center">
|
|
11
|
+
<a href="https://github.com/PHPMailer/PHPMailer/"><img src="images/phpmailer.png" height="90" width="340" alt="PHPMailer rocks"></a>
|
|
12
|
+
</div>
|
|
13
|
+
<p>This example uses <strong>HTML</strong> with the UTF-8 Unicode charset.</p>
|
|
14
|
+
<p>Chinese text: 郵件內容為空</p>
|
|
15
|
+
<p>Russian text: Пустое тело сообщения</p>
|
|
16
|
+
<p>Armenian text: Հաղորդագրությունը դատարկ է</p>
|
|
17
|
+
<p>Czech text: Prázdné tělo zprávy</p>
|
|
18
|
+
<p>Emoji: <span style="font-size: 48px">😂 🦄 💥 📤 📧</span></p>
|
|
19
|
+
<p>Image data URL (base64)<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="#"></p>
|
|
20
|
+
<p>Image data URL (URL-encoded)<img src="data:image/gif,GIF89a%01%00%01%00%00%00%00%21%F9%04%01%0A%00%01%00%2C%00%00%00%00%01%00%01%00%00%02%02L%01%00%3B" alt="#"></p>
|
|
21
|
+
</div>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This example shows how to make use of PHPMailer's exceptions for error handling.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//Import PHPMailer classes into the global namespace
|
|
8
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
9
|
+
use PHPMailer\PHPMailer\Exception;
|
|
10
|
+
|
|
11
|
+
require '../vendor/autoload.php';
|
|
12
|
+
|
|
13
|
+
//Create a new PHPMailer instance
|
|
14
|
+
//Passing true to the constructor enables the use of exceptions for error handling
|
|
15
|
+
$mail = new PHPMailer(true);
|
|
16
|
+
try {
|
|
17
|
+
//Set who the message is to be sent from
|
|
18
|
+
$mail->setFrom('from@example.com', 'First Last');
|
|
19
|
+
//Set an alternative reply-to address
|
|
20
|
+
$mail->addReplyTo('replyto@example.com', 'First Last');
|
|
21
|
+
//Set who the message is to be sent to
|
|
22
|
+
$mail->addAddress('whoto@example.com', 'John Doe');
|
|
23
|
+
//Set the subject line
|
|
24
|
+
$mail->Subject = 'PHPMailer Exceptions test';
|
|
25
|
+
//Read an HTML message body from an external file, convert referenced images to embedded,
|
|
26
|
+
//and convert the HTML into a basic plain-text alternative body
|
|
27
|
+
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
|
|
28
|
+
//Replace the plain text body with one created manually
|
|
29
|
+
$mail->AltBody = 'This is a plain-text message body';
|
|
30
|
+
//Attach an image file
|
|
31
|
+
$mail->addAttachment('images/phpmailer_mini.png');
|
|
32
|
+
//send the message
|
|
33
|
+
//Note that we don't need check the response from this because it will throw an exception if it has trouble
|
|
34
|
+
$mail->send();
|
|
35
|
+
echo 'Message sent!';
|
|
36
|
+
} catch (Exception $e) {
|
|
37
|
+
echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
|
38
|
+
} catch (\Exception $e) { //The leading slash means the Global PHP Exception class will be caught
|
|
39
|
+
echo $e->getMessage(); //Boring error messages from anything else!
|
|
40
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This example shows how to extend PHPMailer to simplify your coding.
|
|
5
|
+
* If PHPMailer doesn't do something the way you want it to, or your code
|
|
6
|
+
* contains too much boilerplate, don't edit the library files,
|
|
7
|
+
* create a subclass instead and customise that.
|
|
8
|
+
* That way all your changes will be retained when PHPMailer is updated.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
//Import PHPMailer classes into the global namespace
|
|
12
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
13
|
+
use PHPMailer\PHPMailer\SMTP;
|
|
14
|
+
use PHPMailer\PHPMailer\Exception;
|
|
15
|
+
|
|
16
|
+
require '../vendor/autoload.php';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Use PHPMailer as a base class and extend it
|
|
20
|
+
*/
|
|
21
|
+
class MyPHPMailer extends PHPMailer
|
|
22
|
+
{
|
|
23
|
+
/**
|
|
24
|
+
* myPHPMailer constructor.
|
|
25
|
+
*
|
|
26
|
+
* @param bool|null $exceptions
|
|
27
|
+
* @param string $body A default HTML message body
|
|
28
|
+
*/
|
|
29
|
+
public function __construct($exceptions, $body = '')
|
|
30
|
+
{
|
|
31
|
+
//Don't forget to do this or other things may not be set correctly!
|
|
32
|
+
parent::__construct($exceptions);
|
|
33
|
+
//Set a default 'From' address
|
|
34
|
+
$this->setFrom('joe@example.com', 'Joe User');
|
|
35
|
+
//Send via SMTP
|
|
36
|
+
$this->isSMTP();
|
|
37
|
+
//Equivalent to setting `Host`, `Port` and `SMTPSecure` all at once
|
|
38
|
+
$this->Host = 'tls://smtp.example.com:587';
|
|
39
|
+
//Set an HTML and plain-text body, import relative image references
|
|
40
|
+
$this->msgHTML($body, './images/');
|
|
41
|
+
//Show debug output
|
|
42
|
+
$this->SMTPDebug = SMTP::DEBUG_SERVER;
|
|
43
|
+
//Inject a new debug output handler
|
|
44
|
+
$this->Debugoutput = static function ($str, $level) {
|
|
45
|
+
echo "Debug level $level; message: $str\n";
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//Extend the send function
|
|
50
|
+
public function send()
|
|
51
|
+
{
|
|
52
|
+
$this->Subject = '[Yay for me!] ' . $this->Subject;
|
|
53
|
+
$r = parent::send();
|
|
54
|
+
echo 'I sent a message with subject ' . $this->Subject;
|
|
55
|
+
|
|
56
|
+
return $r;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//Now creating and sending a message becomes simpler when you use this class in your app code
|
|
61
|
+
try {
|
|
62
|
+
//Instantiate your new class, making use of the new `$body` parameter
|
|
63
|
+
$mail = new myPHPMailer(true, '<strong>This is the message body</strong>');
|
|
64
|
+
//Now you only need to set things that are different from the defaults you defined
|
|
65
|
+
$mail->addAddress('jane@example.com', 'Jane User');
|
|
66
|
+
$mail->Subject = 'Here is the subject';
|
|
67
|
+
$mail->addAttachment(__FILE__, 'myPHPMailer.php');
|
|
68
|
+
$mail->send(); //No need to check for errors - the exception handler will do it
|
|
69
|
+
} catch (Exception $e) {
|
|
70
|
+
//Note that this is catching the PHPMailer Exception class, not the global \Exception type!
|
|
71
|
+
echo 'Caught a ' . get_class($e) . ': ' . $e->getMessage();
|
|
72
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This example shows settings to use when sending via Google's Gmail servers.
|
|
5
|
+
* This uses traditional id & password authentication - look at the gmail_xoauth.phps
|
|
6
|
+
* example to see how to use XOAUTH2.
|
|
7
|
+
* The IMAP section shows how to save this message to the 'Sent Mail' folder using IMAP commands.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
//Import PHPMailer classes into the global namespace
|
|
11
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
12
|
+
use PHPMailer\PHPMailer\SMTP;
|
|
13
|
+
|
|
14
|
+
require '../vendor/autoload.php';
|
|
15
|
+
|
|
16
|
+
//Create a new PHPMailer instance
|
|
17
|
+
$mail = new PHPMailer();
|
|
18
|
+
|
|
19
|
+
//Tell PHPMailer to use SMTP
|
|
20
|
+
$mail->isSMTP();
|
|
21
|
+
|
|
22
|
+
//Enable SMTP debugging
|
|
23
|
+
//SMTP::DEBUG_OFF = off (for production use)
|
|
24
|
+
//SMTP::DEBUG_CLIENT = client messages
|
|
25
|
+
//SMTP::DEBUG_SERVER = client and server messages
|
|
26
|
+
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
|
27
|
+
|
|
28
|
+
//Set the hostname of the mail server
|
|
29
|
+
$mail->Host = 'smtp.gmail.com';
|
|
30
|
+
//Use `$mail->Host = gethostbyname('smtp.gmail.com');`
|
|
31
|
+
//if your network does not support SMTP over IPv6,
|
|
32
|
+
//though this may cause issues with TLS
|
|
33
|
+
|
|
34
|
+
//Set the SMTP port number:
|
|
35
|
+
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
|
|
36
|
+
// - 587 for SMTP+STARTTLS
|
|
37
|
+
$mail->Port = 465;
|
|
38
|
+
|
|
39
|
+
//Set the encryption mechanism to use:
|
|
40
|
+
// - SMTPS (implicit TLS on port 465) or
|
|
41
|
+
// - STARTTLS (explicit TLS on port 587)
|
|
42
|
+
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
|
43
|
+
|
|
44
|
+
//Whether to use SMTP authentication
|
|
45
|
+
$mail->SMTPAuth = true;
|
|
46
|
+
|
|
47
|
+
//Username to use for SMTP authentication - use full email address for gmail
|
|
48
|
+
$mail->Username = 'username@gmail.com';
|
|
49
|
+
|
|
50
|
+
//Password to use for SMTP authentication
|
|
51
|
+
$mail->Password = 'yourpassword';
|
|
52
|
+
|
|
53
|
+
//Set who the message is to be sent from
|
|
54
|
+
//Note that with gmail you can only use your account address (same as `Username`)
|
|
55
|
+
//or predefined aliases that you have configured within your account.
|
|
56
|
+
//Do not use user-submitted addresses in here
|
|
57
|
+
$mail->setFrom('from@example.com', 'First Last');
|
|
58
|
+
|
|
59
|
+
//Set an alternative reply-to address
|
|
60
|
+
//This is a good place to put user-submitted addresses
|
|
61
|
+
$mail->addReplyTo('replyto@example.com', 'First Last');
|
|
62
|
+
|
|
63
|
+
//Set who the message is to be sent to
|
|
64
|
+
$mail->addAddress('whoto@example.com', 'John Doe');
|
|
65
|
+
|
|
66
|
+
//Set the subject line
|
|
67
|
+
$mail->Subject = 'PHPMailer GMail SMTP test';
|
|
68
|
+
|
|
69
|
+
//Read an HTML message body from an external file, convert referenced images to embedded,
|
|
70
|
+
//convert HTML into a basic plain-text alternative body
|
|
71
|
+
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
|
|
72
|
+
|
|
73
|
+
//Replace the plain text body with one created manually
|
|
74
|
+
$mail->AltBody = 'This is a plain-text message body';
|
|
75
|
+
|
|
76
|
+
//Attach an image file
|
|
77
|
+
$mail->addAttachment('images/phpmailer_mini.png');
|
|
78
|
+
|
|
79
|
+
//send the message, check for errors
|
|
80
|
+
if (!$mail->send()) {
|
|
81
|
+
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
|
82
|
+
} else {
|
|
83
|
+
echo 'Message sent!';
|
|
84
|
+
//Section 2: IMAP
|
|
85
|
+
//Uncomment these to save your message in the 'Sent Mail' folder.
|
|
86
|
+
#save_mail($mail->getSentMIMEMessage());
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//Section 2: IMAP
|
|
90
|
+
//This example uses the directorytree/imapengine IMAP library: https://imapengine.com
|
|
91
|
+
//Earlier versions of this code used the deprecated PHP imap_* functions.
|
|
92
|
+
function save_mail($message)
|
|
93
|
+
{
|
|
94
|
+
$mailbox = new \DirectoryTree\ImapEngine\Mailbox([
|
|
95
|
+
'host' => 'imap.gmail.com',
|
|
96
|
+
'port' => 993,
|
|
97
|
+
'encryption' => 'ssl',
|
|
98
|
+
'username' => 'user@example.com',
|
|
99
|
+
'password' => 'password',
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
// Find the "sent" messages folder – yours may have a different name.
|
|
103
|
+
$folder = $mailbox->folders()->find('Sent Mail');
|
|
104
|
+
|
|
105
|
+
$folder->messages()->append($message);
|
|
106
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This example shows how to send via Google's Gmail servers using XOAUTH2 authentication
|
|
5
|
+
* using the league/oauth2-client to provide the OAuth2 token.
|
|
6
|
+
* To use a different OAuth2 library create a wrapper class that implements OAuthTokenProvider and
|
|
7
|
+
* pass that wrapper class to PHPMailer::setOAuth().
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
//Import PHPMailer classes into the global namespace
|
|
11
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
12
|
+
use PHPMailer\PHPMailer\SMTP;
|
|
13
|
+
use PHPMailer\PHPMailer\OAuth;
|
|
14
|
+
//Alias the League Google OAuth2 provider class
|
|
15
|
+
use League\OAuth2\Client\Provider\Google;
|
|
16
|
+
|
|
17
|
+
//SMTP needs accurate times, and the PHP time zone MUST be set
|
|
18
|
+
//This should be done in your php.ini, but this is how to do it if you don't have access to that
|
|
19
|
+
date_default_timezone_set('Etc/UTC');
|
|
20
|
+
|
|
21
|
+
//Load dependencies from composer
|
|
22
|
+
//If this causes an error, run 'composer install'
|
|
23
|
+
require '../vendor/autoload.php';
|
|
24
|
+
|
|
25
|
+
//Create a new PHPMailer instance
|
|
26
|
+
$mail = new PHPMailer();
|
|
27
|
+
|
|
28
|
+
//Tell PHPMailer to use SMTP
|
|
29
|
+
$mail->isSMTP();
|
|
30
|
+
|
|
31
|
+
//Enable SMTP debugging
|
|
32
|
+
//SMTP::DEBUG_OFF = off (for production use)
|
|
33
|
+
//SMTP::DEBUG_CLIENT = client messages
|
|
34
|
+
//SMTP::DEBUG_SERVER = client and server messages
|
|
35
|
+
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
|
36
|
+
|
|
37
|
+
//Set the hostname of the mail server
|
|
38
|
+
$mail->Host = 'smtp.gmail.com';
|
|
39
|
+
|
|
40
|
+
//Set the SMTP port number:
|
|
41
|
+
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
|
|
42
|
+
// - 587 for SMTP+STARTTLS
|
|
43
|
+
$mail->Port = 465;
|
|
44
|
+
|
|
45
|
+
//Set the encryption mechanism to use:
|
|
46
|
+
// - SMTPS (implicit TLS on port 465) or
|
|
47
|
+
// - STARTTLS (explicit TLS on port 587)
|
|
48
|
+
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
|
49
|
+
|
|
50
|
+
//Whether to use SMTP authentication
|
|
51
|
+
$mail->SMTPAuth = true;
|
|
52
|
+
|
|
53
|
+
//Set AuthType to use XOAUTH2
|
|
54
|
+
$mail->AuthType = 'XOAUTH2';
|
|
55
|
+
|
|
56
|
+
//Start Option 1: Use league/oauth2-client as OAuth2 token provider
|
|
57
|
+
//Fill in authentication details here
|
|
58
|
+
//Either the gmail account owner, or the user that gave consent
|
|
59
|
+
$email = 'someone@gmail.com';
|
|
60
|
+
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
|
|
61
|
+
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
|
|
62
|
+
|
|
63
|
+
//Obtained by configuring and running get_oauth_token.php
|
|
64
|
+
//after setting up an app in Google Developer Console.
|
|
65
|
+
$refreshToken = 'RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0';
|
|
66
|
+
|
|
67
|
+
//Create a new OAuth2 provider instance
|
|
68
|
+
$provider = new Google(
|
|
69
|
+
[
|
|
70
|
+
'clientId' => $clientId,
|
|
71
|
+
'clientSecret' => $clientSecret,
|
|
72
|
+
]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
//Pass the OAuth provider instance to PHPMailer
|
|
76
|
+
$mail->setOAuth(
|
|
77
|
+
new OAuth(
|
|
78
|
+
[
|
|
79
|
+
'provider' => $provider,
|
|
80
|
+
'clientId' => $clientId,
|
|
81
|
+
'clientSecret' => $clientSecret,
|
|
82
|
+
'refreshToken' => $refreshToken,
|
|
83
|
+
'userName' => $email,
|
|
84
|
+
]
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
//End Option 1
|
|
88
|
+
|
|
89
|
+
//Option 2: Another OAuth library as OAuth2 token provider
|
|
90
|
+
//Set up the other oauth library as per its documentation
|
|
91
|
+
//Then create the wrapper class that implements OAuthTokenProvider
|
|
92
|
+
$oauthTokenProvider = new MyOAuthTokenProvider(/* Email, ClientId, ClientSecret, etc. */);
|
|
93
|
+
|
|
94
|
+
//Pass the implementation of OAuthTokenProvider to PHPMailer
|
|
95
|
+
$mail->setOAuth($oauthTokenProvider);
|
|
96
|
+
//End Option 2
|
|
97
|
+
|
|
98
|
+
//Set who the message is to be sent from
|
|
99
|
+
//For gmail, this generally needs to be the same as the user you logged in as
|
|
100
|
+
$mail->setFrom($email, 'First Last');
|
|
101
|
+
|
|
102
|
+
//Set who the message is to be sent to
|
|
103
|
+
$mail->addAddress('someone@gmail.com', 'John Doe');
|
|
104
|
+
|
|
105
|
+
//Set the subject line
|
|
106
|
+
$mail->Subject = 'PHPMailer GMail XOAUTH2 SMTP test';
|
|
107
|
+
|
|
108
|
+
//Read an HTML message body from an external file, convert referenced images to embedded,
|
|
109
|
+
//convert HTML into a basic plain-text alternative body
|
|
110
|
+
$mail->CharSet = PHPMailer::CHARSET_UTF8;
|
|
111
|
+
$mail->msgHTML(file_get_contents('contentsutf8.html'), __DIR__);
|
|
112
|
+
|
|
113
|
+
//Replace the plain text body with one created manually
|
|
114
|
+
$mail->AltBody = 'This is a plain-text message body';
|
|
115
|
+
|
|
116
|
+
//send the message, check for errors
|
|
117
|
+
if (!$mail->send()) {
|
|
118
|
+
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
|
119
|
+
} else {
|
|
120
|
+
echo 'Message sent!';
|
|
121
|
+
}
|
|
Binary file
|