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
-
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).
$ composer require tigusigalpa/mailru
require_once 'vendor/autoload.php';
$email = new \Tigusigalpa\MailRu\Sendbox\Email($client_id, $client_secret);
$sms = new \Tigusigalpa\MailRu\Sendbox\SMS($client_id, $client_secret);
$smtp = new \Tigusigalpa\MailRu\Sendbox\SMTP($client_id, $client_secret);
Name | Arguments |
---|---|
sendEmail(array $email) |
$email = ['html' => (string), 'text' => (string), 'template' => ['id' => (int), 'variables' => (string)], 'subject' => (string)] |
Coming soon...
Use environment variables to test API:
- CLIENT_ID (required)
- CLIENT_SECRET (required)
- TIMEOUT (optional)
All coverage tests are coming soon...
MIT License