Commit Graph

174 Commits

Author SHA1 Message Date
Marcus Bointon 12494b1830
Fix syntax 2025-11-24 18:17:31 +01:00
Marcus Bointon 381c209df1
Switch away from the IMAP functions, suggest using an IMAP library instead, and update the example to do that 2025-11-24 18:12:56 +01:00
jrfnl 57ef8c914f
Escape special characters the same way in all PHP versions
The `htmlspecialchars()` function is used to escape arbitrary text strings for display.

Original the default for the `$flags` parameter of that function in PHP was `ENT_COMPAT`, which translates to "convert double quotes to `"` and leave single quotes alone".

As of PHP 8.1, the default value for the `$flags` parameter has been made more robust and was changed to `ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401`, which translates to "convert both double and single quotes, replace invalid code unit sequences with a Unicode Replacement Character and treat code as HTML 4.01".

For code to provide the same/predictable output cross-version PHP, the `$flags` parameter should be explicitly set and what with the new default value being the more robust one, this commit adds that value for `$flags` in all instances of function calls to `htmlspecialchars()`.

Once the application minimum PHP version is PHP 8.1 or higher, the parameter can be removed again (as the value will then be the same as the default parameter value).

Ref: https://www.php.net/manual/en/function.htmlspecialchars.php
2025-11-24 10:50:37 +01:00
jrfnl b9d0e242fb
Examples/mailing_list: remove use of `E_STRICT`
While this is only example code, it is still code which should be functional for all supported PHP versions.

As `E_STRICT` has been deprecated since PHP 8.4 and wasn't really all that useful since PHP 7.0 anyway, it's probably better not to mention it in the example code.

Ref: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant
2025-11-23 05:23:36 +01:00
Marcus Bointon c1c3b24e9c
Unicode is a proper name 2025-04-09 14:12:35 +02:00
Marcus Bointon ab8d4f87a4
Use the `email` field to check for form submission, see #3144 2025-03-04 19:11:22 +01:00
decomplexity e79d9f251b
Additional operands for GoogleAPI for .json management
V4.1.0 of the SendOauth2 wrapper introduces two new optional operands for the invocation of both the standard PHPMailer email application and for the complete replacement of a PHPMailer application by the wrapper SendOauth2A front-end. These operands allow the developer to specify a name for the .json credentials file and/or whether the wrapper should dynamically build this .json file or use an already-built one, created  either by Google (its standard download) or by the developer.
2024-07-04 17:18:57 +01:00
decomplexity 10f8e5a7a9
Additional operands for GoogleAPI for .json management
V4.1.0 of the SendOauth2 wrapper introduces two new optional operands for the invocation of both the standard PHPMailer email application and for the complete replacement of a PHPMailer application by the wrapper SendOauth2A front-end. These operands allow the developer to specify a name for the .json credentials file and/or whether the wrapper should dynamically build this .json file or use an already-built one, created  either by Google (its standard download) or by the developer.
2024-07-04 16:36:48 +01:00
Marcus Bointon dfa731a087
Check broken links, update for HTTPS everywhere 2024-04-01 20:48:10 +02:00
Marcus Bointon 5d698fc44d
Cleanup 2024-03-26 18:26:42 +01:00
decomplexity 749e9a3a9d
OAuth2 for MSFT and Google API with authorization_code or client_credentials
Client secrets and X.509 certificates, $_SESSION 'state' and PKCE code exchanges, and creation on the fly of GoogleAPI's .json credentials files are supported.
2024-03-23 20:29:21 +00:00
Marcus Bointon 760bb5fd27
Add link to aboutmy.email 2024-01-25 10:36:31 +01:00
Marcus Bointon 3190bef442
CS 2023-11-25 23:23:18 +01:00
Marcus Bointon d327514f47
Merge pull request #2985 from decomplexity/patch-1
Create sendoauth2.phps
2023-11-25 23:19:50 +01:00
Marcus Bointon e443047d03
Don't need this to demo xoauth 2023-11-25 23:04:59 +01:00
decomplexity 5a52bddc48
Update sendoauth2.phps
Updated from @synchro's comments
2023-11-24 19:18:36 +00:00
decomplexity fd0e447995
Create sendoauth2.phps
OAuth2 authentication for both Microsoft 365 Exchange email and Google Gmail. Client secrets and X.509 certificates are supported for Exchange. Client secrets are supported for Gmail. Authorization_code grant flow and client_credentials grant flow for SMTP are supported for Exchange. Authorization_code grant flow is supported for Gmail.
2023-11-23 19:43:26 +00:00
Marcus Bointon 677ff5b2f9
CS 2023-11-23 12:12:10 +01:00
Marcus Bointon dd16b7d95b
Add use of replaceCustomHeader in mailing list example, see #2981 2023-11-23 11:59:21 +01:00
Marcus Bointon 3104b10d73
Merge pull request #2852 from mta59066/xclient
XCLIENT implementation
2023-11-23 09:12:59 +01:00
Marcus Bointon 9952101e44
Wrong word 2023-11-17 10:59:11 +01:00
Marcus Bointon b7dd089735
CS 2023-11-08 09:47:00 +01:00
Marcus Bointon b11a4512de
Update SMTP subclass example 2023-11-08 09:44:16 +01:00
Mehmet Tolga Avcioglu 82dd9a01fb improve xclient 2023-01-06 15:59:03 +03:00
Mehmet Tolga Avcioglu 6384753f6e protected xclient variable and added tests 2023-01-04 14:13:07 +03:00
Mehmet Tolga Avcioglu a57dc65962 initial xclient implementation 2023-01-03 17:46:09 +03:00
Jesper Skytte 849615e819
D'oh - forgot to add the example file 2022-10-08 08:02:06 +02:00
Marcus Bointon fb45a2e39b
Use higher debug level when demonstrating TLS options 2022-07-09 17:03:22 +02:00
Marcus Bointon 2611db096a
Merge pull request #2524 from pdscopes/feature/oauth-interface
#2523 OAuth Interface
2022-02-28 14:32:31 +01:00
Marcus Bointon d3f566012b
Fix bug in multiple file upload example, fixes #2569 2021-11-28 14:39:03 +01:00
Peter Scopes 6b5b318025 #2523 updates OAuthTokenProvider usage to gmail_xoauth.phps 2021-10-11 10:26:51 +01:00
Marcus Bointon 723455d1b7
Comment 2021-06-23 23:42:09 +02:00
Marcus Bointon 482e18ee05
Gmail notes 2021-06-23 23:42:08 +02:00
Marcus Bointon e0975c2c86
Prefer SMTPS over SMTP+STARTTLS in examples 2021-06-23 23:42:08 +02:00
Puneet Gopinath d13d6006a4
Fix links (#2285) 2021-03-17 09:38:27 +01:00
Marcus Bointon 0f24617b0c
Consistent comment style 2021-02-19 13:42:01 +01:00
Jérémy VIGNELLES a2e5e89925
Removed missing example link (#2190)
The code_generator.phps example seems to have been removed. Remove the associated link in the README
2020-11-07 15:57:24 +01:00
Marcus Bointon 3dffb3e4ee
Load classes earlier 2020-10-29 15:33:52 +01:00
Marcus Bointon f6321480c5
Retain uploaded extension in the attachment examples so that the MIME type is more easily obtained 2020-10-28 19:06:04 +01:00
Marcus Bointon 22e81749ae
Switch from PHP CS fixer to phpcs and apply PSR12 reformatting 2020-10-13 15:08:42 +02:00
Marcus Bointon 917ab212fa
6.1.8 2020-10-09 16:55:58 +02:00
Suhayb Alghutaymil ec81d13717
Add ajax contact form (#2160)
* Add ajax contact form

* Allow ajax contact form to work if javascript is disabled.

Co-authored-by: Suhayb Alghutaymil <s@sgh.sa>
Co-authored-by: Sohib AlGotimel <sgotimel@citc.gov.sa>
2020-10-07 12:18:31 +02:00
Jérémy PASTOURET a4bf66a1d1
Add MailHog in the code example as a tool for testing email sending (#2151)
* Add MailHog - Testing email sending

* Add MailHog - Testing email sending
2020-10-02 11:47:38 +02:00
Marcus Bointon 35c2cfa9ea
Add destination selector to contact form example 2020-09-30 19:01:03 +02:00
Marcus Bointon db03bb6c1a
Escape output on file upload messages 2020-08-04 08:51:55 +02:00
Marcus Bointon 79b5d815d6
Better error checking & reporting on file uploads 2020-08-04 08:51:48 +02:00
Marcus Bointon 9ce50675c8
Add HELO link 2020-07-15 20:31:23 +02:00
elizabeth m 806531145a
Remove old links from SMTP test server suggestions (#2085)
FakeSMTP's repo is read-only and hasn't been updated since 2016, so I removed it. The link to FakeEmail's repo was pointing at a fork that also hasn't been updated since 2016, so i changed the link to one that has more activity. Also smtp4dev has been moved to Github and works on Linux, so I updated its entry to reflect that.
2020-07-15 20:27:29 +02:00
Marcus Bointon 589ec7d8f3
Access the `$smtp` instance the right way, fixes #1990 2020-02-24 15:01:57 +01:00
Marcus Bointon e4123e66b4 Merge branch 'master' into dkimrevision 2019-10-20 19:37:17 +02:00