Download the PHP package letmesendemail/letmesendemail-php without Composer
On this page you can find all versions of the php package letmesendemail/letmesendemail-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download letmesendemail/letmesendemail-php
More information about letmesendemail/letmesendemail-php
Files in letmesendemail/letmesendemail-php
Package letmesendemail-php
Short Description letmesend.email PHP SDK.
License MIT
Homepage https://letmesend.email/
Informations about the package letmesendemail-php
letmesend.email PHP SDK
The official PHP SDK for the letmesend.email API.
Full Documentation
See the comprehensive user manual for complete documentation of every resource, configuration option, retry behavior, error handling, webhook verification, and detailed examples.
Installation
Quick Start
Configuration
Options
| Option | Default | Description |
|---|---|---|
apiKey |
— | Your letmesend.email API key |
baseUrl |
https://letmesend.email/api/v1 |
API base URL override |
timeout |
30 |
Request timeout in seconds |
retries |
0 |
Maximum number of retry attempts |
API Coverage
This SDK is built from the API fixtures in data/api-data.
Implemented
| Resource | Fixture operations | SDK usage |
|---|---|---|
| Emails | send, send-with-template, verify, list, show |
$client->emails() |
| Domains | list, show, verify |
$client->domains() |
| Contacts | store, list, show, update, delete |
$client->contacts() |
| Contact Categories | store, list, show, update, delete |
$client->contactCategories() |
| Email Topics | store, list, show, update, delete |
$client->emailTopics() |
| Error responses | daily-quote-exceed, monthly-quote-exceed, domain-not-found, domain-unverified, email-size-exceeded |
Typed exceptions |
| Webhooks | Signature verification standard | WebhookSignature::verify(...) |
Emails
Send an email
Attachments
You can provide attachments as raw arrays or as Attachment objects:
Send with a template
Or use TemplateVariable objects:
Idempotency
Pass an idempotencyKey to prevent duplicate sends on retry:
When the API returns a duplicate response (same idempotencyKey used within the expiry window), the response includes "duplicate": true and the isDuplicate() method returns true.
Verify an email address
List emails
Get a single email
Domains
List domains
Get a domain
Verify a domain
Contacts
Create a contact
List contacts
Get a contact
Update a contact
The update() method returns a ContactUpdateResponse which contains only the contact ID.
Delete a contact
Contact Categories
Create a category
List categories
Get a category
Update a category
Delete a category
Email Topics
Create a topic
List topics
Get a topic
Update a topic
Delete a topic
Error Handling
All API errors throw exceptions that extend LetMeSendEmail\Exceptions\ApiException:
| HTTP Status | Exception | Description |
|---|---|---|
| 400, 413, 422 | ValidationError |
Request validation failed |
| 401 | AuthenticationError |
Invalid or missing API key |
| 403 | AuthorizationError |
Insufficient permissions |
| 404 | NotFoundError |
Resource not found |
| 409 | ConflictError |
Resource conflict |
| 429 | RateLimitError |
Rate limit exceeded |
| 500+ | ApiError |
Server error |
| — | NetworkError |
Connection failed |
| — | TimeoutError |
Request timed out |
| — | WebhookVerificationException |
Webhook verification failed |
| — | WebhookSigningException |
Webhook signing configuration error |
Error exceptions provide:
getMessage()— human-readable error description.getHttpStatus()— HTTP status code.getApiCode()— API error code (e.g.,domain_not_found,daily_quota_exceeded).getValidationErrors()— field-level validation errors, if any.getHeaders()— response headers.getRequestId()— request ID for debugging, if present in headers.getRawBody()— raw response body.
Pagination
List endpoints return a response with a PaginationInfo object:
Use cursor-based pagination:
Retries
The SDK can automatically retry idempotent requests on transient failures:
When retries happen
- GET, HEAD, OPTIONS, DELETE requests are always retryable.
- POST, PUT, PATCH requests are retryable only when an
Idempotency-Keyheader is present.
What is retried
NetworkErrorandTimeoutError— connection or timeout failures.- HTTP 408, 429, 500, 502, 503, 504 — retryable server / rate-limit errors.
Backoff strategy
- Rate-limit (429): Uses the
Retry-Afterheader (delta-seconds or HTTP-date), capped at 300 seconds. - Other retryable errors: Bounded exponential backoff with ±25% jitter starting at 100ms base delay. Each delay is capped at 300 seconds. Large attempt numbers are clamped to prevent overflow.
All delays are testable via the SleeperInterface (LetMeSendEmail\Http\SleeperInterface).
Webhooks
Webhook signature verification is built in:
The verifier reads four headers (webhook-id, webhook-log-id, webhook-timestamp,
webhook-signature), validates the timestamp against a configurable tolerance (default 300
seconds), and checks the HMAC-SHA256 signature against the decoded secret.
The signing secret may be prefixed with whsec_. The prefix is stripped automatically before
decoding.
The webhook-signature header supports multiple space-separated versioned signatures.
Only v1 signatures are accepted; unknown versions are ignored.
Testing
Version Support
| PHP Version | Supported |
|---|---|
| 8.1 | Yes |
| 8.2 | Yes |
| 8.3 | Yes |
| 8.4 | Yes |
| 8.5 | Yes |
Changelog
See CHANGELOG.md.