All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createForwarderV1() | POST /api/mail/v1/mailboxes/{mailboxId}/forwarders | Create forwarder |
| deleteForwarderV1() | DELETE /api/mail/v1/forwarders/{forwarderId} | Delete forwarder |
| listForwardersV1() | GET /api/mail/v1/orders/{orderId}/forwarders | List forwarders |
| resendForwarderConfirmationV1() | POST /api/mail/v1/forwarders/{forwarderId}/confirmation/resend | Resend forwarder confirmation |
| updateForwarderKeepCopySettingV1() | PATCH /api/mail/v1/forwarders/{forwarderId}/keep-copy | Update forwarder keep-copy setting |
createForwarderV1($mailboxId, $mailV1SchemaCreateForwarderRequestSchema): \Hostinger\Model\MailV1ForwardersForwarderResourceCreate forwarder
Create a forwarder from the given mailbox to the destination address. The destination receives a confirmation email and forwarding becomes active only after it is confirmed.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\MailForwardersApi(config: $config);
$mailboxId = AC1a2b3c4d5e6f7g; // string | Mailbox resource ID
$mailV1SchemaCreateForwarderRequestSchema = new \Hostinger\Model\MailV1SchemaCreateForwarderRequestSchema(); // \Hostinger\Model\MailV1SchemaCreateForwarderRequestSchema
try {
$result = $apiInstance->createForwarderV1($mailboxId, $mailV1SchemaCreateForwarderRequestSchema);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailForwardersApi->createForwarderV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| mailboxId | string | Mailbox resource ID | |
| mailV1SchemaCreateForwarderRequestSchema | \Hostinger\Model\MailV1SchemaCreateForwarderRequestSchema |
\Hostinger\Model\MailV1ForwardersForwarderResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteForwarderV1($forwarderId): \Hostinger\Model\CommonSuccessEmptyResourceDelete forwarder
Delete a forwarder. The mailbox stops forwarding messages to the destination address immediately.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\MailForwardersApi(config: $config);
$forwarderId = FW1a2b3c4d5e6f7g; // string | Forwarder resource ID
try {
$result = $apiInstance->deleteForwarderV1($forwarderId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailForwardersApi->deleteForwarderV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| forwarderId | string | Forwarder resource ID |
\Hostinger\Model\CommonSuccessEmptyResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listForwardersV1($orderId, $page, $perPage): \Hostinger\Model\MailListForwardersV1200ResponseList forwarders
Retrieve a paginated list of forwarders across all mailboxes of a mail order.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\MailForwardersApi(config: $config);
$orderId = OR1a2b3c4d5e6f7g; // string | Order resource ID
$page = 1; // int | Page number
$perPage = 25; // int | Number of items per page
try {
$result = $apiInstance->listForwardersV1($orderId, $page, $perPage);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailForwardersApi->listForwardersV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | string | Order resource ID | |
| page | int | Page number | [optional] |
| perPage | int | Number of items per page | [optional] [default to 25] |
\Hostinger\Model\MailListForwardersV1200Response
[Back to top] [Back to API list] [Back to Model list] [Back to README]
resendForwarderConfirmationV1($forwarderId): \Hostinger\Model\CommonSuccessEmptyResourceResend forwarder confirmation
Resend the confirmation email to the destination address of an unconfirmed forwarder.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\MailForwardersApi(config: $config);
$forwarderId = FW1a2b3c4d5e6f7g; // string | Forwarder resource ID
try {
$result = $apiInstance->resendForwarderConfirmationV1($forwarderId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailForwardersApi->resendForwarderConfirmationV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| forwarderId | string | Forwarder resource ID |
\Hostinger\Model\CommonSuccessEmptyResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateForwarderKeepCopySettingV1($forwarderId, $mailV1SchemaUpdateForwarderKeepCopyRequestSchema): \Hostinger\Model\CommonSuccessEmptyResourceUpdate forwarder keep-copy setting
Enable or disable keeping a copy of forwarded messages in the mailbox.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\MailForwardersApi(config: $config);
$forwarderId = FW1a2b3c4d5e6f7g; // string | Forwarder resource ID
$mailV1SchemaUpdateForwarderKeepCopyRequestSchema = new \Hostinger\Model\MailV1SchemaUpdateForwarderKeepCopyRequestSchema(); // \Hostinger\Model\MailV1SchemaUpdateForwarderKeepCopyRequestSchema
try {
$result = $apiInstance->updateForwarderKeepCopySettingV1($forwarderId, $mailV1SchemaUpdateForwarderKeepCopyRequestSchema);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailForwardersApi->updateForwarderKeepCopySettingV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| forwarderId | string | Forwarder resource ID | |
| mailV1SchemaUpdateForwarderKeepCopyRequestSchema | \Hostinger\Model\MailV1SchemaUpdateForwarderKeepCopyRequestSchema |
\Hostinger\Model\CommonSuccessEmptyResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]