smtp_host_not_allowed
HTTP status: 400 · Code: smtp_host_not_allowed
A project’s SMTP host is, or resolves to, an address outside the public internet.
Why it happens
Section titled “Why it happens”A project’s SMTP host is, or resolves to, a private, loopback, or other non public address. Projects can only send through servers on the public internet, so a project can’t reach your internal network.
How to fix
Section titled “How to fix”Use a public SMTP host from your email provider. To send through a server on a private network, set it as the install SMTP (in the console’s install email settings) instead of a project’s. See Email delivery.
Catch it in your code
Section titled “Catch it in your code”Every SDK throws one error type for a failed call. Match on its code, which is always smtp_host_not_allowed for this error, never on the message.
import { ErrorCode, OrvanoError } from '@orvano/js'
try { // your Orvano call} catch (error) { if (error instanceof OrvanoError && error.code === ErrorCode.smtpHostNotAllowed) { // handle smtp_host_not_allowed } else { throw error }}import 'package:orvano_flutter/orvano_flutter.dart'; // or orvano_dart on a server
try { // your Orvano call} on OrvanoException catch (error) { if (error.code != ErrorCode.smtpHostNotAllowed) rethrow; // handle smtp_host_not_allowed}using Orvano;
try{ // your Orvano call}catch (OrvanoException error) when (error.Code == ErrorCode.SmtpHostNotAllowed){ // handle smtp_host_not_allowed}The error also carries the HTTP status (400), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.