{"id":326,"date":"2026-11-08T17:00:00","date_gmt":"2026-11-08T12:00:00","guid":{"rendered":"https:\/\/www.shaz3e.com\/blog\/?p=326"},"modified":"2026-11-13T21:20:34","modified_gmt":"2026-11-13T16:20:34","slug":"laravel-mail-failover","status":"publish","type":"post","link":"https:\/\/www.shaz3e.com\/blog\/laravel-mail-failover\/","title":{"rendered":"Laravel Mail Failover: Using Multiple SMTP Servers the Built-In Way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If your app sends password resets, invoices or order updates through one SMTP server, that server is a single point of failure. When it rejects a login, hits a rate limit or simply times out, the user never gets the email and you usually find out from a support ticket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A while back I wrote a dev.to post, <a href=\"https:\/\/dev.to\/shaz3e\/step-by-step-guide-to-sending-emails-in-laravel-using-multiple-smtp-servers-1ie5\" target=\"_blank\" rel=\"noopener\">sending emails in Laravel using multiple SMTP servers<\/a>, that solved this with a custom service: try the main mailer, catch the exception, send again through a backup. It worked. But Laravel now ships two mail transports that do most of this in config alone, <code>failover<\/code> and <code>roundrobin<\/code>. This post is the refreshed version: the built-in way first, then when a small custom service still earns its place, with tests for both.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It belongs to my wider guide on <a href=\"https:\/\/www.shaz3e.com\/blog\/laravel-performance-optimization\/\">Laravel performance optimization for production apps<\/a>, because a mail path that stalls or fails quietly is a production problem, not just a config detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"contents\">What this post covers<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"#versions\">Tested versions<\/a><\/li>\n\n\n<li><a href=\"#failover\">The failover mailer<\/a><\/li>\n\n\n<li><a href=\"#retry-after\">What retry_after actually does<\/a><\/li>\n\n\n<li><a href=\"#roundrobin\">The roundrobin mailer<\/a><\/li>\n\n\n<li><a href=\"#custom\">My older custom approach, refreshed<\/a><\/li>\n\n\n<li><a href=\"#queue\">Queue the mail, not the request<\/a><\/li>\n\n\n<li><a href=\"#tests\">Testing failover without a real SMTP server<\/a><\/li>\n\n\n<li><a href=\"#checklist\">A short checklist<\/a><\/li>\n\n\n<li><a href=\"#faq\">FAQ<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"versions\">Tested versions<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Tool<\/th><th>Version<\/th><\/tr><\/thead><tbody><tr><td>Laravel Framework<\/td><td>13.40.0 (fresh <code>laravel\/laravel<\/code> skeleton)<\/td><\/tr><tr><td>PHP<\/td><td>8.4.27 CLI<\/td><\/tr><tr><td>Mail transport<\/td><td>Symfony Mailer (bundled with Laravel)<\/td><\/tr><tr><td>Tests<\/td><td>PHPUnit through <code>php artisan test<\/code>, 7 tests passing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The tests swap the real SMTP servers for two tiny in-memory transports: one that always throws and one that records what it receives. I didn&#8217;t send anything through a live provider for this post, so treat host names and ports as placeholders and copy the real ones from your provider.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"failover\">The failover mailer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The failover transport takes a list of mailers you already defined in <code>config\/mail.php<\/code>. It sends through the first one. If that throws a transport error, it moves to the next, and so on down the list. Under the hood Laravel builds Symfony&#8217;s <code>FailoverTransport<\/code>, which is documented in the <a href=\"https:\/\/symfony.com\/doc\/current\/mailer.html\" target=\"_blank\" rel=\"noopener\">Symfony Mailer docs<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add a second SMTP mailer next to the default one, then point the failover list at both, with the log mailer last as a safety net while you&#8217;re testing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'mailers' =&gt; [\n\n    'smtp' =&gt; [\n        'transport' =&gt; 'smtp',\n        'host' =&gt; env('MAIL_HOST', '127.0.0.1'),\n        'port' =&gt; env('MAIL_PORT', 2525),\n        'username' =&gt; env('MAIL_USERNAME'),\n        'password' =&gt; env('MAIL_PASSWORD'),\n        'timeout' =&gt; null,\n    ],\n\n    'smtp_backup' =&gt; [\n        'transport' =&gt; 'smtp',\n        'scheme' =&gt; env('MAIL_BACKUP_SCHEME'),\n        'host' =&gt; env('MAIL_BACKUP_HOST'),\n        'port' =&gt; env('MAIL_BACKUP_PORT', 587),\n        'username' =&gt; env('MAIL_BACKUP_USERNAME'),\n        'password' =&gt; env('MAIL_BACKUP_PASSWORD'),\n        'timeout' =&gt; 10,\n    ],\n\n    'failover' =&gt; [\n        'transport' =&gt; 'failover',\n        'mailers' =&gt; [\n            'smtp',\n            'smtp_backup',\n            'log',\n        ],\n        'retry_after' =&gt; env('MAIL_FAILOVER_RETRY_AFTER', 60),\n    ],\n\n    \/\/ ...\n],<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then make it the default in <code>.env<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAIL_MAILER=failover\n\nMAIL_HOST=smtp.primary-provider.example\nMAIL_PORT=587\nMAIL_USERNAME=...\nMAIL_PASSWORD=...\n\nMAIL_BACKUP_HOST=smtp.backup-provider.example\nMAIL_BACKUP_PORT=587\nMAIL_BACKUP_USERNAME=...\nMAIL_BACKUP_PASSWORD=...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s the whole change for most apps. Every <code>Mail::to(...)-&gt;send(...)<\/code> and every notification that uses the mail channel now goes through the failover chain. No controller or mailable has to know about it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things are worth doing on the backup. Give it an explicit <code>timeout<\/code>, because the default can leave a worker waiting a long time on a server that never answers. And make sure the backup&#8217;s sending domain is authenticated with SPF and DKIM too. A backup that lands everything in spam isn&#8217;t really a backup. The Diligent Creators blog has an {link(DC, &#8217;email deliverability checklist&#8217;)} that covers the DNS side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"retry-after\">What retry_after actually does<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>retry_after<\/code> is in seconds, and Laravel defaults it to 60 if you leave it out. When a mailer in the list fails, the transport marks it as dead and skips it for that many seconds. The next message goes straight to the backup instead of waiting on the broken primary again. Each failure is also written to your Laravel log as an error, so a fallback doesn&#8217;t happen silently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The part that&#8217;s easy to miss: once the failover transport has moved to the backup, it stays on the backup for as long as that object lives and the backup keeps working. It doesn&#8217;t switch back the moment <code>retry_after<\/code> runs out. The primary only comes back into play when the backup fails, or when a fresh transport is built. For most apps that&#8217;s fine, but don&#8217;t expect traffic to drift back to the primary on its own inside a long-running worker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One detail surprised me when I first read the Symfony code: that dead list lives in memory, inside the transport object. A long-running queue worker remembers that the primary is down. A normal web request builds a fresh transport each time, so it tries the primary first on every request. If the primary fails by hanging rather than refusing quickly, that&#8217;s another reason to keep its timeout short.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If every mailer in the list fails, you get a <code>TransportException<\/code> saying all transports failed. That&#8217;s what you want. It means a queued mail job fails and retries, instead of pretending the email went out.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"roundrobin\">The roundrobin mailer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Roundrobin uses the same config shape but a different goal. Instead of always starting with the first mailer, it spreads messages across all of them, and it still skips a mailer that just failed. Use it when you have two providers you trust equally and you want to share the load or stay under each one&#8217;s sending limit.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'roundrobin' =&gt; [\n    'transport' =&gt; 'roundrobin',\n    'mailers' =&gt; [\n        'smtp',\n        'smtp_backup',\n    ],\n    'retry_after' =&gt; 60,\n],<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that roundrobin starts at a random mailer, so you can&#8217;t predict which provider sends the first message. If one provider is your main account and the other is a paid emergency route, stick with failover.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>failover<\/th><th>roundrobin<\/th><\/tr><\/thead><tbody><tr><td>Order<\/td><td>Always tries the first healthy mailer<\/td><td>Rotates through mailers, random start<\/td><\/tr><tr><td>Best for<\/td><td>Main provider plus a backup<\/td><td>Two equal providers, load sharing<\/td><\/tr><tr><td>On error<\/td><td>Moves to the next mailer<\/td><td>Moves to the next mailer<\/td><\/tr><tr><td>Dead mailer<\/td><td>Skipped for <code>retry_after<\/code> seconds<\/td><td>Skipped for <code>retry_after<\/code> seconds<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"custom\">My older custom approach, refreshed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original dev.to post wrapped <code>Mail::mailer('smtp')<\/code> in a try\/catch and fell back to <code>Mail::mailer('backup_smtp')<\/code>. With the built-in transports, I&#8217;d no longer start there. I&#8217;d still reach for a small service in a few cases:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>You need to know which mailer actually sent a message, for example to store it on an audit row.<\/li>\n\n\n<li>You want to log or alert on every fallback with your own context, such as the tenant or the mail type.<\/li>\n\n\n<li>Different mail types need different chains, and you&#8217;d rather not define a failover mailer for each one.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the cleaned-up version. It reads the same list the failover mailer uses, catches only transport errors, logs each fallback, and returns the name of the mailer that worked:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nnamespace App\\Services\\Mail;\n\nuse Illuminate\\Contracts\\Mail\\Mailable;\nuse Illuminate\\Support\\Facades\\Log;\nuse Illuminate\\Support\\Facades\\Mail;\nuse Symfony\\Component\\Mailer\\Exception\\TransportExceptionInterface;\n\nclass ResilientMailer\n{\n    \/**\n     * @param  array&lt;int, string&gt;  $mailers  Mailer names from config\/mail.php, in priority order.\n     *\/\n    public function __construct(private array $mailers)\n    {\n    }\n\n    \/**\n     * Try each mailer in order and return the name of the one that sent the message.\n     *\/\n    public function send(string $to, Mailable $mailable): string\n    {\n        $last = null;\n\n        foreach ($this-&gt;mailers as $name) {\n            try {\n                Mail::mailer($name)-&gt;to($to)-&gt;sendNow($mailable);\n\n                return $name;\n            } catch (TransportExceptionInterface $e) {\n                $last = $e;\n\n                Log::warning('Mailer failed, trying the next one', [\n                    'mailer' =&gt; $name,\n                    'error' =&gt; $e-&gt;getMessage(),\n                ]);\n            }\n        }\n\n        throw $last ?? new \\RuntimeException('No mailers configured.');\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s registered once in <code>AppServiceProvider<\/code> so the list stays in config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$this-&gt;app-&gt;singleton(ResilientMailer::class, fn () =&gt; new ResilientMailer(\n    config('mail.mailers.failover.mailers', ['smtp'])\n));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two fixes over the old version. It catches <code>TransportExceptionInterface<\/code> instead of every exception, so a bug in your mailable doesn&#8217;t trigger a pointless resend through the backup. And it rethrows when everything fails, so the caller can&#8217;t miss it. It uses <code>sendNow<\/code> on purpose: the service is meant to run inside a queued job you control, not to queue again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"queue\">Queue the mail, not the request<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The old post sent mail inline, inside the HTTP request. With failover that&#8217;s worse than it sounds: if the primary hangs until its timeout, the user waits for it. Implement <code>ShouldQueue<\/code> on the mailable and let a worker deal with slow or broken servers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nnamespace App\\Mail;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Mail\\Mailable;\nuse Illuminate\\Mail\\Mailables\\Content;\nuse Illuminate\\Mail\\Mailables\\Envelope;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass InvoiceReady extends Mailable implements ShouldQueue\n{\n    use Queueable, SerializesModels;\n\n    public int $tries = 3;\n\n    public array $backoff = [30, 120];\n\n    public function __construct(public string $invoiceNumber)\n    {\n    }\n\n    public function envelope(): Envelope\n    {\n        return new Envelope(subject: \"Invoice {$this-&gt;invoiceNumber} is ready\");\n    }\n\n    public function content(): Content\n    {\n        return new Content(htmlString: \"&lt;p&gt;Your invoice {$this-&gt;invoiceNumber} is ready.&lt;\/p&gt;\");\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With <code>$tries<\/code> and <code>$backoff<\/code>, a total outage on both providers becomes a few spaced retries instead of a lost email. If you haven&#8217;t set up workers for production yet, my post on <a href=\"https:\/\/www.shaz3e.com\/blog\/laravel-queue-workers\/\">Laravel queue workers with Supervisor<\/a> covers that part, and <a href=\"https:\/\/www.shaz3e.com\/blog\/laravel-http-client-retry\/\">retries and timeouts for Laravel HTTP clients<\/a> uses the same thinking for API-based mail providers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tests\">Testing failover without a real SMTP server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need two SMTP accounts to test this. Register two custom transports in the test with <code>Mail::extend()<\/code>: one that always throws a <code>TransportException<\/code>, and one that keeps the messages it gets.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class BrokenTransport extends AbstractTransport\n{\n    public int $attempts = 0;\n\n    protected function doSend(SentMessage $message): void\n    {\n        $this-&gt;attempts++;\n\n        throw new TransportException('Connection to primary SMTP refused.');\n    }\n\n    public function __toString(): string\n    {\n        return 'broken:\/\/';\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The feature test wires them into a failover and a roundrobin mailer, then checks where the mail ended up:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function test_failover_mailer_sends_through_backup_when_primary_fails(): void\n{\n    Mail::mailer('failover')-&gt;to('client@example.com')-&gt;send(new InvoiceReady('INV-1001'));\n\n    $this-&gt;assertSame(1, $this-&gt;primary-&gt;attempts);\n    $this-&gt;assertCount(1, $this-&gt;backup-&gt;sent);\n}\n\npublic function test_failover_skips_a_dead_transport_until_retry_after_passes(): void\n{\n    $mailer = Mail::mailer('failover');\n\n    $mailer-&gt;to('a@example.com')-&gt;send(new InvoiceReady('INV-1'));\n    $mailer-&gt;to('b@example.com')-&gt;send(new InvoiceReady('INV-2'));\n\n    $this-&gt;assertSame(1, $this-&gt;primary-&gt;attempts);\n    $this-&gt;assertCount(2, $this-&gt;backup-&gt;sent);\n}\n\npublic function test_roundrobin_spreads_messages_across_mailers(): void\n{\n    $mailer = Mail::mailer('roundrobin');\n\n    foreach (range(1, 4) as $i) {\n        $mailer-&gt;to(\"user{$i}@example.com\")-&gt;send(new InvoiceReady(\"INV-{$i}\"));\n    }\n\n    $this-&gt;assertCount(2, $this-&gt;backup-&gt;sent);\n    $this-&gt;assertCount(2, $this-&gt;second-&gt;sent);\n}\n\npublic function test_custom_service_falls_back_and_reports_which_mailer_sent(): void\n{\n    $service = new ResilientMailer(['primary', 'backup']);\n\n    $used = $service-&gt;send('client@example.com', new InvoiceReady('INV-2001'));\n\n    $this-&gt;assertSame('backup', $used);\n    $this-&gt;assertCount(1, $this-&gt;backup-&gt;sent);\n}\n\npublic function test_invoice_mail_is_queued_not_sent_inline(): void\n{\n    Mail::fake();\n\n    Mail::to('client@example.com')-&gt;send(new InvoiceReady('INV-3001'));\n\n    Mail::assertQueued(InvoiceReady::class, fn ($mail) =&gt; $mail-&gt;invoiceNumber === 'INV-3001');\n    Mail::assertNothingSent();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The second test is the one I like most. It proves the <code>retry_after<\/code> behaviour: after the first failure, the broken primary isn&#8217;t even tried for the second message. The last test uses <code>Mail::fake()<\/code> to confirm the invoice is queued, not sent inside the request. All seven tests in the demo app pass on Laravel 13.40.0 and PHP 8.4.27.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"checklist\">A short checklist<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Define the backup as its own mailer in <code>config\/mail.php<\/code>, with its own credentials in <code>.env<\/code>.<\/li>\n\n\n<li>Set <code>MAIL_MAILER=failover<\/code> (or roundrobin) and keep <code>retry_after<\/code> explicit.<\/li>\n\n\n<li>Give each SMTP mailer a short <code>timeout<\/code> so a hung server fails fast.<\/li>\n\n\n<li>Authenticate the backup&#8217;s sending domain with SPF and DKIM before you need it.<\/li>\n\n\n<li>Queue mailables, and give the job a few tries with backoff.<\/li>\n\n\n<li>Drop <code>log<\/code> from the production chain once you trust the backup, or you&#8217;ll hide real outages in a log file.<\/li>\n\n\n<li>Test the chain with a throwing transport, not by turning off a real server.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">On shared or reseller hosting, check that outbound SMTP ports aren&#8217;t blocked before you count on a third-party backup. My <a href=\"https:\/\/www.shaz3e.com\/blog\/laravel-hosting-requirements\/\">Laravel hosting requirements<\/a> post lists what to ask your host, and if you also need proper mailboxes for the sending domain, ResellerBytes has a plain guide on <a href=\"https:\/\/resellerbytes.com\/blog\/putting-the-professional-in-professional-email-addresses\/\" target=\"_blank\" rel=\"noopener\">professional email addresses<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-version\">Which Laravel versions have the failover mailer?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Failover has been in Laravel since version 8, and roundrobin arrived later in the 10.x line. Both are in the <a href=\"https:\/\/laravel.com\/docs\/13.x\/mail\" target=\"_blank\" rel=\"noopener\">current Laravel mail docs<\/a>. I tested everything here on Laravel 13.40.0.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-api\">Can I mix SMTP with an API mailer like SES or Postmark?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The list holds mailer names, and any configured mailer works, including <code>ses<\/code>, <code>postmark<\/code>, <code>resend<\/code> or <code>sendmail<\/code>. Mixing an SMTP primary with an API backup is a sensible setup, because the two fail for different reasons.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-notify\">Do notifications use the failover mailer too?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, as long as the mail channel uses the default mailer. If a notification picks a specific mailer with <code>-&gt;mailer('smtp')<\/code>, it skips the chain, so point it at <code>failover<\/code> instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-bounce\">Does failover help when an email bounces?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Failover reacts to transport errors while sending, such as a refused connection, failed login or timeout. A bounce happens later, after the server accepted the message. Handle bounces with your provider&#8217;s webhooks or bounce reports.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-custom\">Should I delete my custom fallback service?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If it only does try-primary-then-backup, yes. Replace it with the failover mailer and delete the code. Keep a service only when you need to know which mailer sent, or want custom logging on each fallback.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>I&#8217;m <a href=\"https:\/\/shaz3e.com\" target=\"_blank\" rel=\"noopener\">Shahrukh Akhtar (Shaz3e)<\/a>, CTO &amp; Co-Founder of Diligent Creators Pvt. Ltd., a Technology Executive &amp; Product Builder. I run client delivery and build SaaS products, including EloSync. You can find me on <a href=\"https:\/\/x.com\/shaz3e\" target=\"_blank\" rel=\"noopener\">X<\/a>, <a href=\"https:\/\/linkedin.com\/in\/shaz3e\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>, <a href=\"https:\/\/peerlist.io\/shaz3e\" target=\"_blank\" rel=\"noopener\">Peerlist<\/a> and <a href=\"https:\/\/github.com\/Shaz3e\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>.<\/em><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>How to send Laravel mail through multiple SMTP servers with the built-in failover and roundrobin mailers, what retry_after really does, when a small custom fallback service still helps, and how to test it all without a real SMTP server. Tested on Laravel 13.40 and PHP 8.4.<\/p>\n","protected":false},"author":2,"featured_media":328,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[122,28,25,53,123,109],"class_list":["post-326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel-php","tag-email","tag-laravel","tag-php","tag-queues","tag-smtp","tag-testing"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/phsTKQ-5g","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.shaz3e.com\/blog\/wp-content\/uploads\/2026\/11\/laravel-mail-failover-1200x630-1.jpg?fit=1200%2C630&ssl=1","_links":{"self":[{"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":2,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions\/346"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/media\/328"}],"wp:attachment":[{"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shaz3e.com\/blog\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}