{"id":3004,"date":"2026-05-06T09:02:08","date_gmt":"2026-05-06T13:02:08","guid":{"rendered":"https:\/\/csimmons.dev\/blog\/?p=3004"},"modified":"2026-05-06T09:27:45","modified_gmt":"2026-05-06T13:27:45","slug":"mailpit-coldfusion-local-email-testing","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2026\/05\/mailpit-coldfusion-local-email-testing\/","title":{"rendered":"Mailpit + ColdFusion Local Email Testing"},"content":{"rendered":"<h2 id=\"overview\">Overview<\/h2>\n<p>This article documents how to configure Adobe ColdFusion to use Mailpit for local email testing.<\/p>\n<p><a href=\"https:\/\/mailpit.axllent.org\/\" target=\"_blank\" rel=\"noopener\">Mailpit<\/a> captures outbound email locally so messages can be reviewed in a browser without sending real email.<\/p>\n<hr \/>\n<h2 id=\"export-existing-mail-settings-%28optional%29\">Export Existing Mail Settings (Optional)<\/h2>\n<p>Before making changes, export the current ColdFusion mail configuration so it can be restored later if needed.<\/p>\n<pre><code>cfconfig export from=server.local to=mailSettings.json includeList=mailservers**<\/code><\/pre>\n<p>Example exported configuration:<\/p>\n<pre><code class=\"json\">{\n    \"mailServers\": [\n        {\n            \"tls\": true,\n            \"password\": \"SUPERSECRET\",\n            \"port\": 587,\n            \"username\": \"USERNAME\",\n            \"ssl\": false,\n            \"smtp\": \"smtp.mailgun.org\"\n        }\n    ]\n}<\/code><\/pre>\n<hr \/>\n<h2 id=\"install-mailpit\">Install Mailpit<\/h2>\n<p>Install Mailpit using Homebrew.<\/p>\n<pre><code>brew install mailpit<\/code><\/pre>\n<hr \/>\n<h2 id=\"start-mailpit\">Start Mailpit<\/h2>\n<p>Start the Mailpit service.<\/p>\n<pre><code>brew services start mailpit<\/code><\/pre>\n<hr \/>\n<h2 id=\"configure-coldfusion-to-use-mailpit\">Configure ColdFusion to Use Mailpit<\/h2>\n<h3 id=\"method-1%3A-configure-with-commandbox\">Method 1: Configure with CommandBox<\/h3>\n<p>Create a file named <code>mailSettingsMailpit.json<\/code>.<\/p>\n<pre><code class=\"json\">{\n    \"mailServers\": [\n        {\n            \"tls\": false,\n            \"password\": \"\",\n            \"port\": 1025,\n            \"username\": \"\",\n            \"ssl\": false,\n            \"smtp\": \"127.0.0.1\"\n        }\n    ]\n}<\/code><\/pre>\n<p>Import the Mailpit configuration into ColdFusion.<\/p>\n<pre><code>cfconfig import from=mailSettingsMailpit.json to=server.local<\/code><\/pre>\n<hr \/>\n<h3 id=\"method-2%3A-configure-in-coldfusion-administrator\">Method 2: Configure in ColdFusion Administrator<\/h3>\n<p>Navigate to:<\/p>\n<pre><code>ColdFusion Administrator \u2192 Server Settings \u2192 Mail<\/code><\/pre>\n<p>Configure the following values:<\/p>\n<pre><code class=\"text\">Mail Server: 127.0.0.1\nServer Port: 1025\nUsername: blank\nPassword: blank\nUse TLS: unchecked\nUse SSL: unchecked<\/code><\/pre>\n<hr \/>\n<h2 id=\"test-email-delivery\">Test Email Delivery<\/h2>\n<p>Create a <code>.cfm<\/code> test page.<\/p>\n<pre><code class=\"cfm\">&lt;cfscript&gt;\n    recipientCount = 5;\n\n    for (i = 1; i &lt;= recipientCount; i++) {\n\n        recipient = \"foo#i#@bar.com\";\n\n        cfmail(\n            to = recipient,\n            from = \"noreply@csimmons.dev\",\n            subject = \"Mailpit Test\",\n            type = \"html\"\n        ) {\n\n            writeOutput(\"\n                &lt;h1&gt;Hello from ColdFusion&lt;\/h1&gt;\n                &lt;p&gt;\n                    It is #dateFormat(now(), 'mm\/dd\/yyyy')# at\n                    #dateTimeFormat(now(), 'hh:mm:ss tt')#.\n                    This should show up in Mailpit.\n                &lt;\/p&gt;\n            \");\n        }\n\n        sleep(3000);\n\n        writeOutput(\"&lt;p&gt;Mail sent.&lt;\/p&gt;\");\n    }\n\n    writeOutput('&lt;p&gt;&lt;a href=\"#cgi.script_name#\"&gt;Run again&lt;\/a&gt;&lt;\/p&gt;');\n&lt;\/cfscript&gt;<\/code><\/pre>\n<hr \/>\n<h2 id=\"verify-email-delivery\">Verify Email Delivery<\/h2>\n<p>Open the Mailpit web interface:<\/p>\n<pre><code>http:\/\/localhost:8025<\/code><\/pre>\n<p>The test emails should appear in the Mailpit inbox.<\/p>\n<figure id=\"attachment_3005\" aria-describedby=\"caption-attachment-3005\" style=\"width: 1014px\" class=\"wp-caption alignnone\"><img width=\"1024\" height=\"374\" data-public-id=\"Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png\" loading=\"lazy\" decoding=\"async\" class=\"wp-post-3004 wp-image-3005 size-large\" src=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_1024,h_374,c_scale\/f_auto,q_auto\/v1778072468\/Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png?_i=AA\" alt=\"Mailpit inbox\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1778072468\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_1024,h_374,c_scale\/f_auto,q_auto\/v1778072468\/Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png?_i=AA 1024w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_300,h_110,c_scale\/f_auto,q_auto\/v1778072468\/Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png?_i=AA 300w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/w_768,h_280,c_scale\/f_auto,q_auto\/v1778072468\/Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png?_i=AA 768w, https:\/\/res.cloudinary.com\/ccsimmons\/images\/f_auto,q_auto\/v1778072468\/Screenshot-2026-05-06-at-8.57.19-AM\/Screenshot-2026-05-06-at-8.57.19-AM.png?_i=AA 1402w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption id=\"caption-attachment-3005\" class=\"wp-caption-text\">Mailpit inbox<\/figcaption><\/figure>\n<hr \/>\n<h2 id=\"restore-original-mail-settings-%28optional%29\">Restore Original Mail Settings (Optional)<\/h2>\n<p>Restore the original ColdFusion mail configuration.<\/p>\n<pre><code>cfconfig import from=mailSettings.json to=server.local<\/code><\/pre>\n<p>Restart ColdFusion after restoring the configuration if required.<\/p>\n<hr \/>\n<h2 id=\"stop-mailpit\">Stop Mailpit<\/h2>\n<p>Stop the Mailpit service.<\/p>\n<pre><code>brew services stop mailpit<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Overview This article documents how to configure Adobe ColdFusion to use Mailpit for local email testing. Mailpit captures outbound email locally so messages can be reviewed in a browser without sending real email. Export Existing Mail Settings (Optional) Before making changes, export the current ColdFusion mail configuration so it can be restored later if needed. &#8230; <a title=\"Mailpit + ColdFusion Local Email Testing\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2026\/05\/mailpit-coldfusion-local-email-testing\/\" aria-label=\"Read more about Mailpit + ColdFusion Local Email Testing\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[48,52],"class_list":["post-3004","post","type-post","status-publish","format-standard","hentry","category-developer","tag-coldfusion","tag-commandbox"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-Ms","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/3004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=3004"}],"version-history":[{"count":1,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/3004\/revisions"}],"predecessor-version":[{"id":3009,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/3004\/revisions\/3009"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=3004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=3004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=3004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}