MimePost API for sending email. You can find out more about MimePost at https://mimepost.com. For obtaining the value of X-Auth-Token you will need to first signup on MimePost
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 0.1.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen
PHP 5.5 and later
To install the bindings via Composer, run the below command:
composer require mimepost/mimepost-php
Then run composer install
include autoload.php
:
require_once('/path/to/mimepost-php/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = MimePost\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MimePost\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new MimePost\Client\Php\EmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \MimePost\Client\Model\Email(); // \Swagger\Client\Model\Email | Single Email object
$body->setSubject('This is a subject');
$body->setFromEmail('[email protected]');
$body->setTo(array( array('email' => '[email protected]') ));
$body->setHtml('<p>This is a test email send using MimePost PHP SDK</p>');
try {
$result = $apiInstance->sendEmail($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailsApi->sendEmail: ', $e->getMessage(), PHP_EOL;
}
To run the unit tests:
./vendor/bin/phpunit
FYI: For testing, you can use the api key special-key
to test the authorization filters.
All URIs are relative to https://api.mimepost.com/v1/
Class | Method | HTTP request | Description |
---|---|---|---|
AccountsApi | accountProfileGet | GET /account/profile/ | Get account profile details |
AccountsApi | accountProfilePost | POST /account/profile/ | Update account profile details |
AccountsApi | settingsGet | GET /settings/ | Get all the settings |
AccountsApi | settingsPost | POST /settings/ | Set a setting |
DomainsApi | domainsGet | GET /domains/ | Get a list of all the domains |
DomainsApi | domainsIdApprovePost | POST /domains/{id}/approve/ | Submit request for the approval of a verified domain |
DomainsApi | domainsIdDelete | DELETE /domains/{id} | Remove a single domain |
DomainsApi | domainsIdGet | GET /domains/{id} | Get the details of a single domain |
DomainsApi | domainsIdVerifyDkimPost | POST /domains/{id}/verify_dkim/ | Request for the verification of DKIM record for a single domain |
DomainsApi | domainsIdVerifySpfPost | POST /domains/{id}/verify_spf/ | Request for the verification of SPF record for a single domain |
DomainsApi | domainsIdVerifyTrackingPost | POST /domains/{id}/verify_tracking/ | Request for the verification of tracking record for a single domain |
DomainsApi | domainsPost | POST /domains/ | Add single domain |
EmailsApi | sendEmail | POST /emails/ | Send email |
StatsApi | emaillogsGet | GET /emaillogs/ | Get the logs of a particular date |
StatsApi | statsGet | GET /stats/ | Get the summary of stats for a range of dates |
WebhooksApi | webhooksGet | GET /webhooks/ | Get the list of all the webhooks |
WebhooksApi | webhooksIdDelete | DELETE /webhooks/{id} | Remove a single webhook |
WebhooksApi | webhooksIdGet | GET /webhooks/{id} | Get the details of a single webhook |
WebhooksApi | webhooksIdPut | PUT /webhooks/{id} | Update the details of a single webhook |
WebhooksApi | webhooksPost | POST /webhooks/ | Add single webhook |
- AccountProfile
- AccountProfileResponse
- AccountSettings
- ApiResponse
- ApiResponseAllWebhooks
- ApiResponseAllWebhooksData
- ApiResponseDomainsList
- ApiResponseDomainsListData
- ApiResponseEmaillogs
- ApiResponseEmaillogsData
- ApiResponseSingleWebhooks
- ApiResponseStats
- ApiResponseStatsData
- ApiResponseStatsDataDatewiseSummary
- ApiResponseStatsDataGraphSummary
- ApiResponseStatsDataTotalSummary
- ApiResponseStatsDataTotalSummaryStatus
- ApiResponseWebhooks
- ApiResponseWebhooksData
- Domain
- EmailAttachments
- EmailGlobalMergeVars
- EmailMergeVars
- EmailTo
- Webhook
- Webhook1
- Type: API key
- API key parameter name: X-Auth-Token
- Location: HTTP header