LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I send HTML formatted text in an email

Solved!
Go to solution

I am trying to send HTML formatted text in an email, but the email message always displays the html code.  I am using LabView 8.6.

 

I've tried following the advice in the following links:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=94185#M94185

 

http://digital.ni.com/public.nsf/websearch/E9544A158AFE8D1C8625705400751DE1?OpenDocument

 

 

But this does not work.  When I change "SMTP Email MIME Text Content-Type.vi", the email is now sent with no text in the body and a data file attachment.

 

Has anyone else had this problem?  I've triplechecked for simple mistakes, but the Knowledge Base tip was pretty easy to follow - it just didn't work.

 

Any help would be appreciated!

-dy 

 

 

0 Kudos
Message 1 of 5
(3,728 Views)

Hi deyyoung,

 

Did you receive any sort of error message or did it just not send any text in the body? Could you please be a bit more descriptive of the behavior you are seeing and what you are expecting to see?

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 2 of 5
(3,699 Views)

No error messages; when the change was made ("text/html" instead of "text/plain"), the resulting email had no message body and a file attachment (no extension) that contained the HTML content.

 

 

What I am trying to get is an email that contains HTML content in the message body and is displayed as HTML content by the email reader (ie, Outlook).  What I get is either a text email with HTML formatting codes displayed or an email with no message body and a file attachment which has the HTML content.

 

I looked through the vi library and found the following path to the SMPTE subVIs:

C:\Program Files\National Instruments\LabVIEW 8.6\vi.lib\Utility\SMTP\

 

I made a copy of this directory into my project folder (on a separate drive) in order to modify the contents.

 

0 Kudos
Message 3 of 5
(3,691 Views)
Solution
Accepted by topic author deyyoung

Hi deyyoung,

 

This is a different KB, but it covers the same topic. When you perform these steps, what do you see?

 

http://digital.ni.com/public.nsf/allkb/D1EDC02799EBE3CB8625705B0056B646?OpenDocument

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

Message 4 of 5
(3,654 Views)

Aaron,

 

I followed the instructions above (note: in LV8.6, the subVI is in the NI_SMTPEmail.lvlib and is called "SMTP Email MIME Text Contect-Type.vi") and this worked.

 

I edited the subVI as shown in the attached picture by creating a enum to select between text/html.  I then propogated this enum up through the VI hierarchy and saved the new version of this vi library in my project folder (I did not edit the original library NI_SMTPEmail.lvlib).  Seems like this would be a good feature addition to LV 2010 🙂

 

Thanks for the assistance, I really appreciate it!

 

-Daniel

 

PS Can the KB be updated for LV8.6 (and 2009)?

0 Kudos
Message 5 of 5
(3,647 Views)