From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add the cid property to the attachment object before sending the email

I want to send an e-mail with an attachment but I need to include a content ID (cid) in the attachment properties (cid=myfilename). This content id will be referenced later from the body of the html email. How can I add the cid property to the attachment object before sending the email in LabView 2014?

0 Kudos
Message 1 of 4
(4,159 Views)

What exactly do you mean by attachment property? Can you include the cid in the name of the attachment?

 

But here are some resources about sending attachment in an email:

http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/sending_attchmnts_in_email/

 

example of sending email attachments:

http://forums.ni.com/t5/Example-Program-Drafts/Sending-SMTP-Email-Attachments-from-LabVIEW/ta-p/3509...

 

 

0 Kudos
Message 2 of 4
(4,093 Views)

When an e-mail with an attachment is added to the SMTP client the attachment has different properties. One of them is the filename, another one is the MIME type, there is an optional property named Content-ID (cid). Once I set the value of this property, I can reference that value from the html message body. For example, if an image attachment has the property cid: myimage, then I can reference it inside the message in an img tag as <img src=cid:myimage> this will display the image directly in the body of the message that can be seen right away, but not as an attachment that I have to click on to open.

The first reference that you provided describe sending e-mail in LabView 2010. In LabView 2014 it seems it is done by different vis. By the way, there is an option to set Content-type of an attachment in LabView 2010 (but not Content-ID), that I just did not see in LabView 2014.

The second reference shows how to send-mails using constructors, I am sure it must be possible to set Content-ID following this path, I just do not know how exactly to do that.

0 Kudos
Message 3 of 4
(4,083 Views)

Thank you for providing the second reference. After small modification of the code I was able to set the content-id and see the image directly in the message body.

 

0 Kudos
Message 4 of 4
(4,071 Views)