SMTP Support for Sendinblue?

http://olympicnunriflers.epizy.com/

Error sending email: 502 Bad Gateway / nginx

I was just wondering if infinityfree for any reason blocks outgoing emails through smtp via sendinblue. I get this error when I enter my email address into the “mailing list” html form. it’s not a mailing list, it sends 1 email then never contacts you again unless you re-enter your details. I’m really new to this and don’t know why this is happening. could anyone help me understand why the 502 error is occuring?
Thanks

Welcome!

As far as I am aware, Sendinblue SMTP is not blocked.

Can you try turning on display errors in the control panel (Under PHP config), and turn on any debug logs on the SMTP platform you are using (I am assuming it is PHPMailer).

3 Likes

I tried to switch from using smtp to sendinblue’s API and now i get the following:

This page isn’t working

olympicnunriflers.epizy.com is currently unable to handle this request.

HTTP ERROR 500

i am very confused as to whats happening

this is my code:

<?php
use SendinBlue\Client\Configuration;
use SendinBlue\Client\Api\TransactionalEmailsApi;
use SendinBlue\Client\Model\SendSmtpEmail;
// Configure API key authorization: api-key
$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'MY_API_KEY_HIDDEN');

$api_instance = new SendinBlue\Client\Api\TransactionalEmailsApi(
    new GuzzleHttp\Client(),
    $config
);

$name = $_POST['name'];
$email = $_POST['email'];

$send_smtp_email = new \SendinBlue\Client\Model\SendSmtpEmail();
$send_smtp_email['subject'] = 'Test Email';
$send_smtp_email['htmlContent'] = "<h1>Hello $name,</h1><p>Thank you for signing up to the Killer Nun Mailing List! We hope you enjoy your time with us.</p>";
$send_smtp_email['sender'] = ['name' => 'J.E.Fievez', 'email' => '[email protected]'];
$send_smtp_email['to'] = ['email' => $email, 'name' => $name];

try {
    $result = $api_instance->sendTransacEmail($send_smtp_email);
    // Redirect to thank you page if email is sent successfully
    header('Location: thank_you.php');
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailsApi->sendTransacEmail: ', $e->getMessage(), PHP_EOL;
}

//API KEY => MY_API_KEY_HIDDEN

?>

Again:

2 Likes

i don’t know how to do that
i had a look but i couldn’t find it

  1. Open control panel
  2. Select “Alter PHP Config”
  3. Select domain name
  4. Turn on PHP errors

Just because you don’t know how to do something does not mean you can skip it. If your confused, just ask!

4 Likes

Just to note: since you’re using Sendinblue’s API client, you’re probably sending email using their own HTTP API, not SMTP. Most email sending platforms have their own APIs in addition to standard SMTP, which is usually more efficient and provides some other options.

We don’t block either SMTP or using most third party APIs. But even if SMTP were blocked, you would not be affected.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.