> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apollodeploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send emails with PHP

> Send a transactional email with the official Apollo Signal PHP SDK

The PHP SDK provides a class-based client and uses
`https://api.signal.apollodeploy.com` by default.

Before you start, [create an API key](/signal/create-an-api-key) with **Emails: Send** permission
and [verify the From domain](/signal/add-a-domain).

<Steps>
  <Step title="Install the SDK">
    ```bash theme={"dark"}
    composer require apollo-deploy/signal-sdk
    ```
  </Step>

  <Step title="Store your API key">
    Set `SIGNAL_API_KEY` in the server environment or secret manager.
  </Step>

  <Step title="Send an email">
    ```php theme={"dark"}
    <?php

    require __DIR__ . '/vendor/autoload.php';

    use Apollo\Deploy\Signal\Sdk\Client;
    use Apollo\Deploy\Signal\Sdk\SendEmailRequest;

    $signal = new Client([
        'defaultHeaders' => [
            'Authorization' => 'Bearer ' . getenv('SIGNAL_API_KEY'),
        ],
    ]);

    $request = new SendEmailRequest();
    $request->from = 'auth@mail.company.com';
    $request->to = ['alex@example.com'];
    $request->subject = 'Reset your password';
    $request->text = 'Use the secure link in your account to choose a new password.';

    $email = $signal->emails()->sendEmail($request);
    echo $email->id . PHP_EOL;
    ```
  </Step>
</Steps>

<Note>
  PHP and Laravel use the same Composer package. Recipient fields are arrays, and the From domain
  must be verified in the same Signal project as the API key.
</Note>

<CardGroup cols={2}>
  <Card title="Laravel" icon="code" href="/signal/send-with/send-with-laravel">
    Use the package's Laravel service provider.
  </Card>

  <Card title="All SDKs" icon="code" href="/signal/send-with/sdk-overview">
    Compare every supported language and framework.
  </Card>
</CardGroup>
