Download the PHP package loremipsum-systems/emailit without Composer
On this page you can find all versions of the php package loremipsum-systems/emailit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package emailit
EmailItMailer Library
The EmailItMailer
library is a PHP wrapper for interacting with the EmailIt API, allowing you to send emails and manage sending domains effortlessly. Built on top of GuzzleHttp
, this library aims to streamline the process of integrating email features into your project.
Features
- Send emails with HTML, text, custom headers, and file attachments.
- Retrieve a list of sending domains with pagination and filtering.
- Fetch detailed information about a specific sending domain.
Requirements
- PHP 8.1 or higher
- Composer
- Required dependencies (managed via Composer):
guzzlehttp/guzzle
(HTTP client)psr/http-client
,psr/http-message
,psr/http-factory
ralouphie/getallheaders
symfony/deprecation-contracts
Installation
Use Composer to install the library:
Usage
Initialization
First, create a new instance of EmailItMailer
by providing your API key.
Sending an Email
To send an email, use the send
method. This method supports the following parameters:
from
: Sender's email address.to
: Recipient's email address.subject
: Email subject.htmlContent
: (Optional) HTML email content.textContent
: (Optional) Plain text email content.attachments
: (Optional) Array of file attachments.headers
: (Optional) Array of custom headers.
Here’s an example:
Managing Sending Domains
Get a List of Sending Domains
Retrieve a paginated list of all sending domains using the getSendingDomains
method:
Fetch Details of a Sending Domain
To get detailed information about a specific sending domain, use the getSendingDomain
method:
Error Handling
All methods in the EmailItMailer
class throw standard PHP Exception
s. Common reasons for exceptions include:
- Invalid API credentials.
- HTTP or network errors during API requests.
- Invalid input, such as malformed attachments.
Use try...catch
blocks to handle exceptions gracefully, as shown in the examples above.
Contributing
We welcome contributions to improve the library. Feel free to:
- Fork the repository.
- Submit a Pull Request (PR) with your improvements.
- Ensure all code changes include tests and documentation updates (if applicable).
License
This library is released under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or need further assistance, please reach out at [email protected] or open a GitHub issue.
Acknowledgments
This library leverages the following dependencies:
- GuzzleHttp for making HTTP requests.
- PSR request and response libraries for standardized HTTP message handling.
Notes for Developers
- Ensure you have proper API documentation access while working with the API endpoints.
- Always validate attachments before sending email requests to avoid errors.