{"id":15481678,"url":"https://github.com/daniel-zahariev/php-aws-ses","last_synced_at":"2025-04-08T11:09:44.537Z","repository":{"id":13708365,"uuid":"16402313","full_name":"daniel-zahariev/php-aws-ses","owner":"daniel-zahariev","description":"PHP classes that interfaces Amazon Simple Email Service","archived":false,"fork":false,"pushed_at":"2022-10-06T19:52:15.000Z","size":87,"stargazers_count":308,"open_issues_count":27,"forks_count":99,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-01T09:32:11.326Z","etag":null,"topics":["amazon","aws-ses","composer","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel-zahariev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-31T07:34:15.000Z","updated_at":"2025-01-02T05:02:00.000Z","dependencies_parsed_at":"2022-08-07T07:15:39.757Z","dependency_job_id":null,"html_url":"https://github.com/daniel-zahariev/php-aws-ses","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zahariev%2Fphp-aws-ses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zahariev%2Fphp-aws-ses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zahariev%2Fphp-aws-ses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zahariev%2Fphp-aws-ses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-zahariev","download_url":"https://codeload.github.com/daniel-zahariev/php-aws-ses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829511,"owners_count":21002997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","aws-ses","composer","php"],"created_at":"2024-10-02T05:05:30.203Z","updated_at":"2025-04-08T11:09:44.516Z","avatar_url":"https://github.com/daniel-zahariev.png","language":"PHP","funding_links":["https://opencollective.com/php-aws-ses/contribute","https://opencollective.com/php-aws-ses","https://opencollective.com/php-aws-ses/organization/0/website","https://opencollective.com/php-aws-ses/organization/1/website","https://opencollective.com/php-aws-ses/organization/2/website","https://opencollective.com/php-aws-ses/organization/3/website","https://opencollective.com/php-aws-ses/organization/4/website","https://opencollective.com/php-aws-ses/organization/5/website","https://opencollective.com/php-aws-ses/organization/6/website","https://opencollective.com/php-aws-ses/organization/7/website","https://opencollective.com/php-aws-ses/organization/8/website","https://opencollective.com/php-aws-ses/organization/9/website"],"categories":[],"sub_categories":[],"readme":"**Amazon Simple Email Service provides a simple way to send e-mails without having to maintain your own mail server. Those PHP classes use the REST-based interface to that service.**\n\n[![Build Status](https://travis-ci.org/daniel-zahariev/php-aws-ses.svg?branch=master)](https://travis-ci.org/daniel-zahariev/php-aws-ses)\n[![CircleCI](https://circleci.com/gh/daniel-zahariev/php-aws-ses/tree/master.svg?style=svg)](https://circleci.com/gh/daniel-zahariev/php-aws-ses/tree/master)\n\n---\n\n\u003e This repository is a fork from version 0.8.2 of the [original classes](http://www.orderingdisorder.com/aws/ses/) developed by **Dan Myers**\n\u003e Read the [old docs here](README_old.md)\n\n---\n\n## Table of Contents\n\n*   [Installation](#installation)\n*   [Basic Usage](#basic-usage)\n*   [Recipients](#recipients)\n*   [Message body](#message-body)\n*   [Attachments](#attachments)\n*   [Sending Bulk Messages](#sending-bulk-messages)\n*   [API Endpoints](#api-endpoints)\n*   [Helper Methods](#helper-methods)\n\n### Installation\n\nInstall the latest version with\n\n    composer require daniel-zahariev/php-aws-ses\n\n### Basic Usage\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\n$m = new SimpleEmailServiceMessage();\n$m-\u003eaddTo('Recipient Name \u003crecipient@example.com\u003e');\n$m-\u003esetFrom('Sender \u003cuser@example.com\u003e');\n$m-\u003esetSubject('Hello, world!');\n$m-\u003esetMessageFromString('This is the message body.');\n\n$ses = new SimpleEmailService('AccessKey', 'SecretKey');\nprint_r($ses-\u003esendEmail($m));\n\n// Successful response should print something similar to:\n//Array(\n//     [MessageId] =\u003e 0000012dc5e4b4c0-b2c566ad-dcd0-4d23-bea5-f40da774033c-000000\n//     [RequestId] =\u003e 4953a96e-29d4-11e0-8907-21df9ed6ffe3\n//)\n```\n\n### Recipients\n\n```php\n\u003c?php\n\n$m = new SimpleEmailServiceMessage();\n// Add many Recipients\n$m-\u003eaddTo(array('dwight@example.com', 'angela@example.com'));\n\n// You can either add one by one or pass an array to 'To' and 'CC'\n$m-\u003eaddCC('holly@example.com');\n$m-\u003eaddCC(array('kelly@example.com', 'ryan@example.com'));\n\n// And 'BCC' and 'Reply-To' as well\n$m-\u003eaddBCC('michael@example.com');\n$m-\u003eaddBCC(array('kevin@example.com', 'oscar@example.com'));\n$m-\u003eaddReplyTo('andy@example.com');\n$m-\u003eaddReplyTo(array('stanley@example.com', 'erin@example.com'));\n\n\n// Also add names to any of the Recipients lists\n$m-\u003eaddTo('Jim Carrey \u003cjim@example.com\u003e');\n```\n\n### Message body\n\n```php\n\u003c?php\n\n// Additionally you can set the content of the email via:\n$m-\u003esetMessageFromFile('/path/to/some/file.txt');\n$m-\u003esetMessageFromURL('http://example.com/somefile.txt');\n\n// And have both Text and HTML version with:\n$m-\u003esetMessageFromString($text, $html);\n$m-\u003esetMessageFromFile($textfilepath, $htmlfilepath);\n$m-\u003esetMessageFromURL($texturl, $htmlurl);\n\n// Remember that setMessageFromString, setMessageFromFile, and setMessageFromURL are mutually exclusive.\n// If you call more than one, then whichever call you make last will be the message used.\n\n// You can also set the encoding of the Subject and the Message Body\n$m-\u003esetSubjectCharset('ISO-8859-1');\n$m-\u003esetMessageCharset('ISO-8859-1');\n```\n\nThe default is UTF-8 if you do not specify a charset, which is usually the right setting. You can read more information in the [SES API documentation](http://docs.amazonwebservices.com/ses/latest/APIReference/API_Content.html)\n\n### Attachments\n\n```php\n\u003c?php\n\n$m-\u003eaddAttachmentFromData('my_text_file.txt', 'Simple content', 'text/plain');\n$m-\u003eaddAttachmentFromFile('my_PFD_file.pdf', '/path/to/pdf/file', 'application/pdf');\n\n// SendRawEmail is explicitly used when there are attachments:\n$ses-\u003esendEmail($m);\n// Sending raw email can be enforsed with:\n$ses-\u003esendEmail($m, $use_raw_request = true);\n\n// Now you can add an inline file in the message\n$m-\u003eaddAttachmentFromFile('logo.png','path/to/logo.png','application/octet-stream', '\u003clogo.png\u003e' , 'inline');\n// and use it in the html version of the e-mail: \u003cimg src='cid:logo.png' /\u003e\n```\n\n### Configuration Set and Message Tags\n\n```php\n\u003c?php\n\n// Set the configuration set\n$m-\u003esetConfigurationSet('myConfigurationSet');\n\n// Reset the configuration set\n$m-\u003esetConfigurationSet(null);\n\n\n// Set message tag\n$m-\u003esetMessageTag('key', 'value');\n\n// Get message tag\n$tag = $m-\u003egetMessageTag('key');\n\n// Remove message tag\n$m-\u003eremoveMessageTag('key');\n\n// Set message tags in bulk - performs merge with current tags\n$m-\u003esetMessageTags(array('key1' =\u003e 'value1', 'key2' =\u003e 'value2'));\n\n// Get message tags\n$tags = $m-\u003egetMessageTags();\n\n// Remove all message tags\n$m-\u003eremoveMessageTags();\n```\n\n### Sending Bulk Messages\n\nWhen hundreds of emails have to be sent in bulk it's best to use the Bulk mode which essentially reuses a CURL handler and reduces the number of SSL handshakes and this gives a better performance.\n\n```php\n\u003c?php\n\n// Enable bulk sending mode (reuse of CURL handler)\n$ses-\u003esetBulkMode(true);\n\n// Send the messages\nforeach($messages as $message) {\n\t$ses-\u003esendEmail($message);\n}\n\n// Disable bulk sending mode\n$ses-\u003esetBulkMode(false);\n```\n\n### API Endpoints\n\nFew [Regions and Amazon SES endpoints](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html) are available and they can be used like this:\n\n```php\n\u003c?php\n\n$region_endpoint = SimpleEmailService::AWS_US_EAST_1;\n$ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint);\n```\n\n### Helper Methods\n\n```php\n\u003c?php\n\n// Get the addresses that have been verified in your AWS SES account\n$ses-\u003elistVerifiedEmailAddresses();\n// Delete a verified address\n$ses-\u003edeleteVerifiedEmailAddress('user@example.com');\n// Send a confirmation email in order to verify a new email\n$ses-\u003everifyEmailAddress('user@example.com');\n\n// Get Send Quota\n$ses-\u003egetSendQuota();\n// Get Send Statistics\n$ses-\u003egetSendStatistics()\n```\n\nSee the documentation on [GetSendQuota](http://docs.amazonwebservices.com/ses/latest/APIReference/API_GetSendQuota.html) and [GetSendStatistics](http://docs.amazonwebservices.com/ses/latest/APIReference/API_GetSendStatistics.html) for more information on these calls.\n\n### Errors\n\nBy default when Amazon SES API returns an error it will be triggered with [`trigger_error`](http://php.net/manual/en/function.trigger-error.php):\n\n```php\n\u003c?php\n\n// Set the default behaviour for handling errors\n$trigger_error = true;\n$ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint, $trigger_error);\n\n// Or overwrite the main setting on a single call\n$use_raw_request = false;\n$trigger_error = false;\n$ses-\u003esendEmail($m, $use_raw_request, $trigger_error);\n```\n\n### Request Signature Version\n\nYou can configure which version of the request signature should be used. [Version 4](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html) is now supported and used by default.\n\n```php\n\u003c?php\n\n$signature_version = SimpleEmailService::REQUEST_SIGNATURE_V4;\n$ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint, $trigger_error, $signature_version);\n```\n\n\n\n### Changelog\n\nv.0.9.5\n*   Fix for arrays in request query params (#83) \n\nv.0.9.4\n*   Fix for PHP8 errors (#81)\n\nv.0.9.3\n\n*   AWS Signature Version 4 is the default one (thanks to [VincentNikkelen](https://github.com/VincentNikkelen))\n*   Added support for more regions (thanks to [VincentNikkelen](https://github.com/VincentNikkelen))  \n\nv.0.9.2\n\n*   Added support for AWS Signature Version 4\n\nv.0.9.1\n\n*   Added support for AWS SES Configuration Sets and Message Tags\n*   Added caching mechanism in `SimpleEmailServiceMessage` to speed up bulk sending mode\n\nv.0.9.0\n\n*   Add parameter for raw message encoding\n\nv.0.8.9\n\n*   Merge pull request 32 from hlev/remove-to-requirement\n\nv.0.8.8\n\n*   Issues fixed: #24, #25, #30, #31\n*   added a method `setBulkMode` in `SimpleEmailService` which can enable reuse of `SimpleEmailServiceRequest` object for bulk sending of requests to AWS SES\n*   new methods in `SimpleEmailService`: `getVerifyPeer`, `setVerifyPeer`, `getVerifyHost`, `setVerifyHost`, `getBulkMode`, `setBulkMode`, `getRequestHandler` (protected)\n*   methods marked as deprecated in `SimpleEmailService`: `enableVerifyHost`, `enableVerifyPeer`, `verifyHost`, `verifyPeer`\n*   new methods in `SimpleEmailServiceMessage`: `clearTo`, `clearCC`, `clearBCC`, `clearReplyTo`, `clearRecipients`\n*   new methods in `SimpleEmailServiceRequest`: `setVerb`, `clearParameters`, `getCurlHandler` (protected)\n*   updated `validate` method in `SimpleEmailServiceMessage`\n*   added some phpDocumentor blocks\n\nv.0.8.7\n\n*   Minor updates\n\nv.0.8.6\n\n*   Removed dummy code\n*   Removed version from source files\n\nv.0.8.5\n\n*   A few issues are fixed #9, #10, #10\n*   Pull request for Adding an inline file is merged\n*   Pull request for fixing a 'From: ' field error with Raw messages is merged\n*   Composer file added and submited to Packagist.org\n*   Triggering an error is now optional (on by default)\n*   Added class constants in `SimpleEmailService` for easy selection of region API endpoint\n\nv.0.8.4\n\n*   Added method `addCustomHeader` to class `SimpleEmailServiceMessage` for adding custom headers when the `SendRawEmail` call is used (#7)\n*   `SendRawEmail` method can be enforced with a new parameter of `sendEmail` function\n*   Recipients are now base64 encoded by default when the format is `Name \u003cEmail\u003e` (#3)\n*   Most of the notices should be cleared now (#5)\n\nv.0.8.3\n\n*   Made automatic use of `SendRawEmail` REST API call when there are attachments\n\nv.0.8.2.\n\n*   Inital impport\n\n### Todo List\n\n*   Fully document the class methods with phpdoc tags\n*   Build documentation with phpDocumentor\n*   Move examples to files\n*   Make a [Composer](https://packagist.org/) package\n*   Allow X-Headers usage\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/daniel-zahariev/php-aws-ses/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/php-aws-ses/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/php-aws-ses\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/php-aws-ses/contribute)]\n\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/php-aws-ses/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/php-aws-ses/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n\n### License\n\nMIT License\n\nCopyright (c) 2011 Dan Mayers\nCopyright (c) 2014 Daniel Zahariev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-zahariev%2Fphp-aws-ses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-zahariev%2Fphp-aws-ses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-zahariev%2Fphp-aws-ses/lists"}