tigusigalpa / mailru
MailRu for business SendBox service API
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tigusigalpa/mailru
Requires
- php: >=5.6.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: 3.5.0
This package is auto-updated.
Last update: 2025-10-18 06:22:03 UTC
README
PHP wrapper of Mail.Ru for business to work with the API. For the moment its only Sendbox integration. Official documentation https://help.mail.ru/biz/sendbox/api
Install
Client side
-
Add your domain to Mail.Ru. Approve domain via any available method: DNS TXT record or HTML file or HTML meta-tag or change domain NS records to mail.ru
-
Configure domain MX-records. Keep only Mail.Ru backed MX-records:
- Host/subdomain:
@ - Value:
emx.mail.ru - Priority:
10
- Host/subdomain:
-
Configure SPF-record (TXT domain record):
- Host/subdomain:
@ - Value:
v=spf1 redirect=_spf.mail.ru - TTL:
21600
If you are using any paid services like SMTP, your SPF-record may be another but only single one. For example, if you are using an SMTP service, SPF (TXT) record will be
v=spf1 include:send-box.ru include:smtp.send-box.ru redirect=_spf.mail.ru - Host/subdomain:
-
Configure DKIM signature. There may be a up to 3 DKIM records, depending on number of connected services.
-
Get API credentials. Go to https://mailer.i.bizml.ru/settings/, select an API tab, activate REST API, copy ID (CLIENT ID) and Secret (CLIENT SECRET).
Developer side
$ composer require tigusigalpa/mailru
require_once 'vendor/autoload.php';
Sendbox
$email = new \Tigusigalpa\MailRu\Sendbox\Email($client_id, $client_secret);
SMS
$sms = new \Tigusigalpa\MailRu\Sendbox\SMS($client_id, $client_secret);
SMTP
$smtp = new \Tigusigalpa\MailRu\Sendbox\SMTP($client_id, $client_secret);
Available methods
| Name | Arguments |
|---|---|
sendEmail(array $email) |
$email = ['html' => (string), 'text' => (string), 'template' => ['id' => (int), 'variables' => (string)], 'subject' => (string)] |
Coming soon...
PHPUnit tests
Use environment variables to test API:
- CLIENT_ID (required)
- CLIENT_SECRET (required)
- TIMEOUT (optional)
All coverage tests are coming soon...
License
MIT License
