Sendinblue smtp receiving mails after 10+ minutes

434 Views Asked by At

I'm using the PHP SDK for sending smtp mails. My class looks like this:

class Mailer
{
    public function mail($sender, $to, $subject, $body)
    {
        $config = Configuration::getDefaultConfiguration()->setApiKey('api-key', 'my-key');

        $apiInstance = new SMTPApi(
            new Client(),
            $config
        );

        $sendSmtpEmail = new SendSmtpEmail(); 

        $sendSmtpEmail->setSender($sender);
        $sendSmtpEmail->setTo([$to]);
        $sendSmtpEmail->setHtmlContent($body);
        $sendSmtpEmail->setSubject($subject);

        try {
            $apiInstance->sendTransacEmail($sendSmtpEmail);
        } catch (Exception $e) {
            echo 'Exception when calling SMTPApi->sendTransacEmail: ', $e->getMessage(), PHP_EOL;
        }
    }
}

The problem is that I receive the mails after more than 10+ minutes. Why is this not instant? Because now the customer has to wait for more than 10 minutes before he/she can sign in.

0

There are 0 best solutions below