gartmedia / php-email-library
PHP email/form handling for GARTMedia
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/gartmedia/php-email-library
Requires
- php: >=7.4
- phpmailer/phpmailer: 6.5.0
Requires (Dev)
- phpmailer/phpmailer: 6.5.0
This package is auto-updated.
Last update: 2025-12-18 01:59:41 UTC
README
Wrapper for PHPmailer for ease of use
Usage
use Email\Email; use Email\EmailAddress as Address; $data = [ "from" => Address::newAddress($email, $name), "to" => [ Address::newAddress("info@example.com", "Max Mustermann") ], // add custom fields to message body "body" => [ "subject" => $subject, "customField" => $customField ], // attach files to mail "files" => [ ["tmp_name" => "temp", "name" => "test.txt"], ["tmp_name" => "temp2", "name" => "test2.txt"] ] ]; $settings = [ // enables recaptcha authentication "recaptcha" => [ "secret" => "your recaptcha secret", "response" => $recaptchaResponse, "scoreThreshold" => 0.9 // recaptcha v3 score threshold (default = 0.5) ], "html" => true // enable html mail ]; $mail = new Email($data, $settings); try { $mail->send(); } catch (Exception $e) { echo $e; }