08-26-2009 08:43 AM
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
Solved! Go to Solution.
08-28-2009 09:08 AM
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
08-28-2009 09:36 AM
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.
09-02-2009 01:08 PM
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
09-02-2009 02:17 PM
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)?
