Download the PHP package dealnews/aws-ses without Composer

On this page you can find all versions of the php package dealnews/aws-ses. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aws-ses

dealnews/aws-ses

A fluent PHP wrapper around the AWS SDK's SES v2 client for sending email — build a message with a chainable API, send it, and get back a typed result. No raw AWS SDK arrays to hand-assemble, no MIME to build by hand.

Features

Installation

Requires PHP 8.2+ and aws/aws-sdk-php (installed automatically as a dependency).

You'll also need AWS credentials configured wherever this runs (environment variables, an IAM instance/task role, a shared credentials file, etc.) with permission to call ses:SendEmail, and a verified sending identity (domain or email address) in SES.

Quick Start

Usage Examples

Multiple recipients

Call to(), cc(), bcc(), or replyTo() once per address — each call appends a recipient rather than replacing the list:

Attachments

Attach raw bytes directly, or read a file from disk:

attachFromPath() defaults the recipient-facing filename to the source file's basename and detects the content type from the file itself; both can be overridden with the second and third arguments.

Custom headers and configuration sets

Handling errors

API Overview

DealNews\AwsSes\Message

The fluent builder used to describe an email. All setters return $this, so calls chain. Getters (getFrom(), getTo(), etc.) are also available if you need to inspect a message you've built.

Method Description
from(string $email, ?string $name = null) Sets the sender address.
to(string $email, ?string $name = null) Appends a "to" recipient. Call once per recipient.
cc(string $email, ?string $name = null) Appends a "cc" recipient.
bcc(string $email, ?string $name = null) Appends a "bcc" recipient.
replyTo(string $email, ?string $name = null) Appends a "reply-to" address.
subject(string $subject) Sets the subject line.
text(string $body) Sets the plain text body.
html(string $body) Sets the HTML body.
attach(string $content, string $filename, string $content_type = 'application/octet-stream') Appends an attachment from raw content.
attachFromPath(string $path, ?string $filename = null, ?string $content_type = null) Appends an attachment read from disk.
header(string $name, string $value) Adds a custom email header.
configurationSetName(string $name) Sets the SES configuration set to send under.
charset(string $charset) Sets the charset for the subject/body (default UTF-8).
hasAttachments(): bool Whether one or more attachments have been added.
validate(): void Throws MissingRequiredFieldException if a required field (from, at least one recipient, subject, a text or HTML body) is missing. Called automatically by Mailer::send().

A Message requires, at minimum, a from, at least one recipient (to/cc/bcc), a subject, and a text and/or html body.

DealNews\AwsSes\Mailer

Wraps a configured Aws\SesV2\SesV2Client. send() validates the message, builds the SES v2 SendEmail request (envelope from Message, Content from EmailContentBuilder), and returns a SendResult. Any exception from the AWS SDK is caught and rethrown as SendException, with the original exception available via getPrevious().

The second constructor argument is mainly useful for testing or advanced customization — the default EmailContentBuilder is used if you don't pass one.

DealNews\AwsSes\EmailContentBuilder

Builds the Content parameter of the SES v2 SendEmail request from a Message. Always builds Content.Simple — subject, body, and (when present) Headers and Attachments — since SES v2's Simple content natively supports both. You generally won't call this directly; Mailer does it for you.

DealNews\AwsSes\SendResult

Returned by Mailer::send() on success.

DealNews\AwsSes\Address, Header, Attachment

Small value objects used internally and returned from Message's getters.

Exceptions (DealNews\AwsSes\Exception)

Exception Thrown when
AwsSesExceptionInterface (marker interface, not thrown directly) — implemented by every exception below, so you can catch any of them at once.
ValidationException Base class for all build-time validation errors below. Extends \InvalidArgumentException.
InvalidAddressException An email passed to from()/to()/cc()/bcc()/replyTo() fails validation.
MissingRequiredFieldException Message::validate() finds a missing required field.
AttachmentException Attachment::fromPath() can't read the given file.
SendException The AWS SDK throws while calling SendEmail. Extends \RuntimeException; the original exception is available via getPrevious().

Testing

Run the test suite:

This runs parallel-lint followed by PHPUnit (with coverage). Individual tools are also available directly:

Tests never make real AWS calls — Aws\SesV2\SesV2Client is constructed with an Aws\MockHandler that intercepts requests and returns canned responses. If you're testing code that uses this library, the same approach works well:

To assert on the request that would have been sent, append a closure instead of a Result — it receives the Aws\CommandInterface and must return the Result to respond with:

Code Style

This repo uses php-cs-fixer (config in .php-cs-fixer.dist.php):

License

BSD-3-Clause. See the license field in composer.json.


All versions of aws-ses with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
aws/aws-sdk-php Version ^3.300
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dealnews/aws-ses contains the following files

Loading the files please wait ...