Programming

Programming

Programming

Can ChatGPT code your email?

Joey Lee

October 31, 2025

ChatGPT can code in Python, build apps, and debug scripts. Can it also build your email templates? It is a fair question. More marketers are trying to use AI to generate HTML for newsletters, announcements, and transactional messages. The short answer: kind of, but with some serious limits still (as of this blog going live October 2025).

Yes, kind of, for very basic emails

Example 1: Robinhood “Account safety tips”

We grabbed a Robinhood design from reallygoodemails.com, then prompted ChatGPT 5 with:

  • “Please code this email in HTML. I want to paste the HTML into my ESP. It should be ready to go.”

As you can see in the table below, the email is a simple, text-heavy, one-column layout from Robinhood. The results were solid. On Gmail and Outlook 365, the rendering was clean and readable. It also looked good on mobile devices.

Design given to ChatGPT

Render on Gmail with provided code from prompt

Render on MSFT Outlook 365 with provided code from prompt

Where it falls short:

  • Using this method is not clearly faster than using your ESP’s drag-and-drop editor. You likely already have a template like this, and you could have simply just pasted in your copy into your template.

  • In our testing, fonts, spacing, and colors can change between prompts. So while ChatGPT is good at delivering a decent looking email, there won’t be brand consistency using this prompt method each time.

Verdict: Good for a quick mockup or an internal test. Not a production workflow.

For anything complex, not really

Example 2: Sundays newsletter

We grabbed a Sundays design from reallygoodemails.com, then prompted ChatGPT 5 with the same prompt:

  • “Please code this email in HTML. I want to paste the HTML into my ESP. It should be ready to go.”

As you can see in the table below, this is a bit more complex. Multi-block layout, images, and distinct brand styling. To our surprise, ChatGPT produced a good-looking email, but it did not match the design. Spacing, typography, and image alignment drifted. The brand-feel changed. It's clearly not ready for this kind of prompt.

Design given to ChatGPT

Render on Gmail with provided code from prompt

A neat surprise was that ChatGPT filled in Unsplash dog images in the HTML. That is clever, but it is not on-brand or production safe.

If you handed this back to the designer, it would not land. It is functional HTML, but not the intended design.

Verdict: Surprisingly good looking email, but not what we requested.

What if you give ChatGPT only specs, no design?

We supplied a lightweight design system with fonts, hex codes, padding rules, and coding examples. The output looked once again surprisingly good in Gmail desktop, but the HTML started breaking down on Outlook, and not shown here was poor mobile responsiveness.

Render on Gmail with provided code from prompt

Render on Outlook web with provided code from prompt

Furthermore, we would not expect ChatGPT to be able create a cohesive set of ten templates that align across clients. Even getting one template dialed in took repeated prompting and still needed human cleanup. We are sure you would be able to reprompt ChatGPT into giving pretty clean HTML that renders across multiple clients, but having ChatGPT do this on future templates as well and keep a consistent brand, we have a hard time seeing how it would be an effective tool at this time. 

Verdict: Useful for starter code. Not enough to reach the finish line.

Why email is harder than vibe coding

Email HTML is from the 1990s. So how can ChatGPT not be as good at this as it is with Python scripts? It sounds easier, but it is actually the opposite.

AI performs best when it has freedom to interpret the goal and fill in the gaps. That is why “vibe coding” works for Python scripts, small web apps, or even simple frontend layouts. The AI can choose its own structure, libraries, and styling decisions to get to a functional result.

Email development is the opposite. It is full of constraints. Every layout depends on strict table nesting, inline CSS, and ancient rendering quirks. You are not designing for one browser or runtime, but for dozens of unpredictable environments, Outlook, Gmail, Apple Mail, Yahoo, and more. Each has its own bugs, limitations, and overrides.

In web or Python projects, there is flexibility. In email, there is none. ChatGPT can write HTML that looks fine in a preview, but it cannot predict how that HTML will render across clients. It cannot see that Outlook will collapse a div or that Gmail will strip a media query.

Email coding is less about creativity and more about discipline. It is about knowing every constraint and working within them. That is exactly where AI still struggles.

Closing thoughts

In our testing, ChatGPT was able to code simple emails using basic prompts like “Please code this email in HTML. I want to paste the HTML into my ESP. It should be ready to go.” For one-column, text-based layouts, it handled structure, spacing, and typography surprisingly well.

But we don’t think this would change how most companies actually build and manage their emails today. Brand teams need consistent templates, accessible code, and reliable rendering across every client. That still requires a human developer who understands how small details behave across Outlook, Gmail, and mobile.

Where ChatGPT can help is in exploration, drafting quick mockups, scaffolding layouts, or converting early design ideas into starting HTML.

Still, there are real use cases for AI in the email building workflow. We’ll cover those in our next post: Smart ways to use ChatGPT for coding emails.