Download the PHP package rafaame/php-aws-ses without Composer

On this page you can find all versions of the php package rafaame/php-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 php-aws-ses

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.


This repository is a fork from version 0.8.2 of the original classes developed by Dan Myers


Example usages

A bit of example code will be a good demonstration of how simple this class is to use. Please read through these examples, and then feel free leave a comment if you have any questions or suggestions.

First, you’ll need to create a SimpleEmailService class object:

require_once('SimpleEmailService.php');
require_once('SimpleEmailServiceMessage.php');
require_once('SimpleEmailServiceRequest.php');
$ses = new SimpleEmailService('Access Key Here', 'Secret Key Here');

If this is your first time using Simple Email Service, you will need to request verification of at least one e-mail address, so you can send messages:

print_r($ses->verifyEmailAddress('[email protected]'));
-------
Array
(
  [RequestId] => 1b086469-291d-11e0-85af-df1284f62f28
)

Every request you make to SimpleEmailService will return a request id. This id may be useful if you need to contact AWS about any problems. For brevity, I will omit the request id if it is the only value returned from a service call.

After you’ve requested verification, you’ll get an e-mail at that address with a link. Click the link to get your address approved. Once you’ve done that, you can use it as the ‘From’ address in the e-mails you send through SES. If you don’t have production access yet, you’ll also need to request verification for all addresses you want to send mail to.

If you want to see what addresses have been verified on your account, it’s easy:

print_r($ses->listVerifiedEmailAddresses());
-------
Array
(
  [RequestId] => 77128e89-291d-11e0-986f-43f07db0572a
  [Addresses] => Array
    (
      [0] => [email protected]
      [1] => [email protected]
    )
)

Removing an address from the verified address list is just as easy:

$ses->deleteVerifiedEmailAddress('[email protected]');

This call will return a request id if you need it.

The only thing left to do is send an e-mail, so let’s try it. First, you’ll need a SimpleEmailServiceMessage object. Then, you’ll want to set various properties on the message. For example:

$m = new SimpleEmailServiceMessage();
$m->addTo('[email protected]');
$m->setFrom('[email protected]');
$m->setSubject('Hello, world!');
$m->setMessageFromString('This is the message body.');

print_r($ses->sendEmail($m));
-------
Array
(
  [MessageId] => 0000012dc5e4b4c0-b2c566ad-dcd0-4d23-bea5-f40da774033c-000000
  [RequestId] => 4953a96e-29d4-11e0-8907-21df9ed6ffe3
)

And that’s all there is to it!

There are a few more things you can do with this class. You can make two informational queries, try these out:

print_r($ses->getSendQuota());
print_r($ses->getSendStatistics());

For brevity I will not show the output of those two API calls. This information will help you keep track of the health of your account. See the Simple Email Service documentation on GetSendQuota and GetSendStatistics for more information on these calls.

You can set multiple to/cc/bcc addresses, either individually or all at once:

$m->addTo('[email protected]');
$m->addTo(array('[email protected]', '[email protected]'));
$m->addCC('[email protected]');
$m->addCC(array('[email protected]', '[email protected]'));
$m->addBCC('[email protected]');
$m->addBCC(array('[email protected]', '[email protected]'));

These calls are cumulative, so in the above example, three addresses end up in each of the To, CC, and BCC fields.

You can also set one or more Reply-To addresses:

$m->addReplyTo('[email protected]');
$m->addReplyTo(array('[email protected]', '[email protected]'));

You can set a return path address:

$m->setReturnPath('[email protected]');

You can use the contents of a file as the message text instead of a string:

$m->setMessageFromFile('/path/to/some/file.txt');
// or from a URL, if allow_url_fopen is enabled:
$m->setMessageFromURL('http://example.com/somefile.txt');

If you have both a text version and an HTML version of your message, you can set both:

$m->setMessageFromString($text, $html);

Or from a pair of files instead:

$m->setMessageFromFile($textfilepath, $htmlfilepath);
// or from a URL, if allow_url_fopen is enabled:
$m->setMessageFromURL($texturl, $htmlurl);

Remember that setMessageFromString, setMessageFromFile, and setMessageFromURL are mutually exclusive. If you call more than one, then whichever call you make last will be the message used.

Finally, if you need to specify the character set used in the subject or message:

$m->setSubjectCharset('ISO-8859-1');
$m->setMessageCharset('ISO-8859-1');

The 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.


This library does not support now supports the SendRawEmail call, which means you cannot can send emails with attachments or custom headers, and unfortunately I will be unable to add that support.

The SendRawEmail call is used automatically when there are attachments:

$m->addAttachmentFromData('my_text_file.txt', 'Simple content', 'text/plain');
$m->addAttachmentFromFile('my_PFD_file.pdf', '/path/to/pdf/file', 'application/pdf');
// SendRawEmail call will now be used:
$ses->sendEmail($m);

Changelog

v.0.8.3

v.0.8.2.

Todo List

Bitdeli Badge


All versions of php-aws-ses with dependencies

PHP Build Version
Package Version
No informations.
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 rafaame/php-aws-ses contains the following files

Loading the files please wait ...