{"id":38811763,"url":"https://github.com/angeljunior/aws-ses","last_synced_at":"2026-01-17T12:56:04.824Z","repository":{"id":17192581,"uuid":"81324108","full_name":"angeljunior/aws-ses","owner":"angeljunior","description":"PHP class to send emails via Amazon (AWS) Simple Email Service (SES) with REST interface","archived":false,"fork":false,"pushed_at":"2023-02-22T20:46:34.000Z","size":24,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T03:50:36.584Z","etag":null,"topics":["amazon","amazon-ses","aws","aws-ses","ses","simple-email-service"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angeljunior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-08T11:43:01.000Z","updated_at":"2022-11-03T06:07:04.000Z","dependencies_parsed_at":"2022-09-19T16:52:36.038Z","dependency_job_id":null,"html_url":"https://github.com/angeljunior/aws-ses","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/angeljunior/aws-ses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeljunior%2Faws-ses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeljunior%2Faws-ses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeljunior%2Faws-ses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeljunior%2Faws-ses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angeljunior","download_url":"https://codeload.github.com/angeljunior/aws-ses/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeljunior%2Faws-ses/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","amazon-ses","aws","aws-ses","ses","simple-email-service"],"created_at":"2026-01-17T12:56:04.277Z","updated_at":"2026-01-17T12:56:04.813Z","avatar_url":"https://github.com/angeljunior.png","language":"PHP","funding_links":[],"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*Version 4 is now supported by default.*\n\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\n### Installation\nInstall the latest version with\n\n\tcomposer require angeljunior/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@example.com');\n$m-\u003esetFrom('user@example.com');\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\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\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$m-\u003esetMessageFromHTMLString($html);\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\n### Sending Bulk Messages\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\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\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\n\n### Changelog\nv.1.0.5.\n\n - Signature v4\n\nv.1.0.0.\n\n - Inital impport\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeljunior%2Faws-ses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangeljunior%2Faws-ses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeljunior%2Faws-ses/lists"}