Solution
LabVIEW 2013 and LaterLabVIEW 2013 and later include
SMTP Email VIs on the SMTP Email palette. The newer SMTP Email palette includes the
Set Message VI. Use the
Text & HTML instance of this VI to send an HTML-formatted message.
LabVIEW 2012 and EarlierYou will have to make some slight modifications to the
Email VIs to send an HTML formatted email because, by default, LabVIEW sends plain text. For a server to use HTML to read an e-mail, the header must specify that this particular email is formatted using HTML.
This header is created by a subVI two levels down into the SMTP Email Send Message VI. To send formatted emails, you need to find the VI that writes the header and change the input to this VI from "text/plain" to "text/html". In order to find and change the input to the header VI, you should follow these steps:
- Begin with SMTP Email Send Message.vi
- Double-click to open and look at the block diagram.
- Open the VI called SMTP Email Send Message Charset.vi (located on the right)
- Next, open the VI called SMTP Email Send Text Message.vi (located in the middle)
- The SMTP Email MIME Send Header.vi is where you need to specify usage of HTML. The input to this header VI is written by SMTP Email MIME Text Content-Type.vi. Open SMTP Email MIME Text Content-Type.vi
- Inside you will see the following string, as also displayed below: text/plain;%s charset="%s
- Change the word plain to html.
- Save the VI, but keep a copy of the old VI so that you can revert to the shipped version if needed.