Non‑ASCII Email Subject Garbling in LabVIEW SMTP Shipping Example

Updated Feb 5, 2026

Reported In

Software

  • LabVIEW

Issue Details

How to prevent non‑ASCII characters in email subject from appearing garbled when sending email using LabVIEW SMTP shipping example, Send Email using SMTP Client.vi?

Figure 1. SMTP Shipping Example

Solution

To avoid garbled characters in the email subject line, the subject text needs to be converted to UTF‑8 before being encoded in Base64. Also, instead of inserting the subject through Set Message Text.vi, the subject header should be set directly using Set Headers.vi.

 

Because LabVIEW does not include a native UTF‑8 conversion function, a toolkit from the VI Package Manager is used to provide this feature. For Base64 encoding, Base64 Fast Encode 2012 NIVerified.vi from the Fast Base64 Encoder/Decoder using LabVIEW example package is used.

 

Updating the Send Email event structure in LabVIEW shipping example with the UTF‑8 conversion, Base64 encoding, and revised header‑setting logic (see Figure 2), the email subject is handled correctly.
 

Figure 2. Set Headers.vi Implementation for UTF‑8 Base64 Subject Encoding

 

Additional Information

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project.

To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block.