Fix a NetSuite Invoice Email That Breaks in Outlook

An Advanced PDF/HTML template can preview perfectly and still arrive garbled by email. Assign an email copy on the invoice form, then strip the PDF macros and wrap the invoice in a centered 600px table.

The quick answer

The template editor's Preview runs the PDF renderer, so it shows how the invoice prints, not how a mail client shows it. PDF-only markup like <macrolist> headers and footers, <pagenumber/> and the page attributes on <body> have no meaning in an email. In this example they leave a stray "of" under the invoice date, and the template's 100%-wide tables stretch across the reading pane. Keep a separate email copy of the template, set it as the Email Template on the invoice form, move the header into the body, delete the macro list, and wrap the invoice in <table align="center" width="600" style="width: 600px;">. Then send a real test email and look at it.

The screenshots show sample data. Person, company, and customer names are fictional. Use your own templates, forms, and a mailbox you control when following the steps.

Before you start

This example starts from Fernbrook Invoice Email Template, an Advanced PDF/HTML template made by copying the source of the company's invoice PDF template. You need the Advanced PDF/HTML Templates feature turned on and a role that can edit Advanced PDF/HTML templates and transaction forms and email invoices. The Email Template field only appears on a form whose Printing Type is Advanced.

Test with an invoice whose To Be E-mailed address is a real test mailbox you control, never a customer's. Here that's INV30918 for Alder Point Clinic, total 334.87, sent to ar-test@fernbrooksupply.example. If you test in a sandbox, check where it sends outbound email, since sandboxes can redirect or hold it.

Changing a form's Email Template affects every transaction that uses the form. Try it in a sandbox first, or note the form's current Email Template so you can put it back.

Whether the invoice goes into the message body as HTML or gets attached as a PDF depends on your account's transaction email settings, the customer's email preference (PDF, HTML, or Default), and, if you send from the Email Message window, the format you pick there. This walkthrough tests the HTML-in-body path, so make sure nothing forces a PDF attachment for your test customer.

01. Preview the email template

Go to Customization > Forms > Advanced PDF/HTML Templates and click Edit next to Fernbrook Invoice Email Template. It opens with the Source Code toggle on; turn it on if yours opens in the visual editor.

The source is still the PDF template's. A <macrolist> holds the nlheader macro with the company name, address, Invoice title, number, and date, and the nlfooter macro prints <pagenumber/> of <totalpages/>.

The email copy still has the PDF's macro list, including the page-number footer on line 21.

Click Preview. The Letter page looks right: header at the top, totals, and 1 of 1 at the bottom. That's the PDF engine at work. Click Close preview.

Preview renders a clean PDF page with the header at the top.
The footer macro prints 1 of 1 at the bottom of the page.

02. Assign it on the invoice form

Go to Customization > Forms > Transaction Forms and click Edit next to Fernbrook Service Invoice. Printing Type is Advanced and Print Template is Fernbrook Invoice PDF Template. Leave those alone.

Email Template still says Standard Invoice PDF/HTML Template, so emailed invoices ignore your new template until you change it. Choose Fernbrook Invoice Email Template and click Save. Email Message Template is a different field; it controls the subject and message text around the invoice, and it stays as is.

Print Template stays on the PDF template; Email Template points at the email copy.

03. Email a test invoice

Open INV30918 from Recent Records. Its Custom Form is Fernbrook Service Invoice, the form you just changed. Making a form preferred only changes the default for new invoices, so check this field on your own test invoice before you send it. On the Communication subtab, To Be E-mailed shows ar-test@fernbrooksupply.example and the Messages list is empty.

The invoice uses Fernbrook Service Invoice and emails the test mailbox.

Scroll back up and click Actions > Email.

Actions > Email sends the invoice with the form's Email Template.

NetSuite sends the invoice to the To Be E-mailed address. Communication > Messages now lists it, to ar-test@fernbrooksupply.example with the subject Fernbrook Supply Co.: Invoice #INV30918. Depending on your account and release, Email may open an Email Message window instead, where you confirm the recipient and format before Merge & Send. If To Be E-mailed is blank, you'll have to add an address before the invoice can go out. Either way, confirm the recipient is your test mailbox and that the invoice is going in the body rather than as a PDF attachment.

The sent email is logged under Communication > Messages.

A logged message only proves NetSuite sent it. It says nothing about how the email looks.

04. Check the received email

Open the message in the test mailbox. The invoice is there, but it isn't the page Preview showed. The footer macro's contents landed in the body. The page-number tags produce nothing in an email, so only the "of" between them is left, sitting under the invoice date. Every table set to 100% stretches across the whole reading pane, which pushes the $334.87 total box far to the right of Bill To.

A stray "of" from the page-number footer, and tables stretched to the edge of the pane.

05. Rebuild the layout for email

Go back to Customization > Forms > Advanced PDF/HTML Templates and click Edit next to Fernbrook Invoice Email Template. All of the repair happens in its source.

First, save the header. Put the cursor at the start of line 8, the header table inside nlheader. Press Shift+Down Arrow nine times to select through </table> on line 16, and cut it (Ctrl+X, or Cmd+X on a Mac). The nlheader macro is now empty.

Midway through, the header table is on the clipboard and the nlheader macro on lines 7 and 8 is empty.

Next, remove the macros. In this template the only things that use them are the header and footer attributes on <body>, which you replace in a moment; if your copy has other macro references, such as a <pbr> tag, deal with those too. Put the cursor at the start of line 6, <macrolist>, press Shift+Down Arrow eleven times to select through </macrolist>, and press Backspace. That deletes the empty header macro and the footer with the page number. <style> now follows the font link, and <body> still carries header, footer, padding, and size attributes that only mean something to the PDF renderer.

Midway through, the macro list is gone, but line 17's body tag still has its PDF page attributes.

Now open the wrapper. Click right after <body on that line, select to the end of the line (Shift+End, or Shift+Cmd+Right Arrow on a Mac), and type > so the line reads <body>. Press Enter and type:

<table align="center" width="600" style="width: 600px;"><tr><td>

Press Enter again and paste the header table (Ctrl+V or Cmd+V). Press Delete to remove the empty line left after it. The width goes in both the width attribute and style because some versions of desktop Outlook honor the attribute more reliably than CSS.

Line 18 opens the centered 600px table, with the header pasted right under it.

Finally, close it. Click at the start of the </body> line, type </td></tr></table>, and press Enter so the table closes just before </body>. Click Save.

Line 68 closes the wrapper right before the closing body tag.

06. Email it again and compare

Open INV30918 from Recent Records and click Actions > Email again. Communication > Messages now lists a second email to ar-test@fernbrooksupply.example.

Two logged emails: the broken one and the repaired one.

In the test mailbox, open the newest message.

The repaired email: one header, no stray "of", and a centered 600px invoice.

Check the result

  1. The Fernbrook Supply Co. header appears once, at the top of the invoice.
  2. Nothing sits under the invoice date 09/24/2026. The stray "of" is gone.
  3. The invoice sits in a centered column instead of stretching across the pane, with the $334.87 total box beside Bill To.
  4. The item lines and totals still read $307.50, $27.37, and $334.87.

Preview still renders this template as a PDF page, so keep judging it by the received email. Before you point real customers at it, send the same test to each mail client they use, including phones and desktop Outlook, which handles less CSS than a browser. Stick to tables and inline style attributes, use cell padding or spacer rows instead of CSS margins, and pick one common font like Arial.

Common questions

What's the difference between Print Template and Email Template?

Both fields sit on a custom transaction form whose Printing Type is Advanced. Print Template is the Advanced PDF/HTML template used when the invoice is printed or saved as a PDF. Email Template is the one NetSuite uses when the invoice itself is sent by email, so you can keep the PDF template for printing and give email its own layout.

Why does Preview look right when the email doesn't?

Preview renders the template through the PDF engine, which understands macro headers and footers, page numbers, and page size and padding on the body tag. A mail client understands none of that. A clean Preview only tells you the PDF is fine, so the real test is a received email.

Can I use my Advanced PDF template as the email template?

As a starting point, yes. Copy its source into a new template, then strip the PDF-only parts: move the header into the body, delete the macro list, remove the page attributes from the body tag, and wrap the content in one centered fixed-width table. Assigning the untouched PDF template as the Email Template is how you end up with the stray "of".

Why does Actions > Email still use the old template?

The Email Template comes from the form the invoice uses. Check the invoice's Custom Form field, then check that form's Email Template. Making a different form preferred only changes the default for new invoices. Email Message Template won't help either; it controls the subject and message text, not the invoice layout.

How wide should a NetSuite invoice email be?

Around 600px is the usual choice. Wrap everything in one table with align="center", width="600", and style="width: 600px;". Tables set to 100% stretch to whatever width the reading pane happens to be, which is what pushed the total box to the far right in this example.

How do I test an invoice email template without bothering customers?

Use a test invoice whose To Be E-mailed address is a mailbox you control, on the same form your customers' invoices use. Send it, confirm it shows up under Communication > Messages, then open the received email in each client your customers use. The logged message proves NetSuite sent it, not that it looks right.