LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

smtp email (MS office toolkit) can't open attachments

I'm using the SMTP Email send file.vi to send a Word.doc file as an attachment. The .doc file is the result of the MS office report.vi opening a template, filling the bookmarks, then saving the file as a .doc.

The .doc is then opened with the New report.vi, printed (print report.vi), then disposed (disposed report.vi). The .doc is then attached to an email using SMTP email send file.vi.

The email(s) are arriving without problem and the attachment is visible. If, however, the attachment is double clicked, it will not open. The error message indicates that there may be either path or security problems. There is not, I'm sure of it.

Additionally, I tried saving the attachment "SAVE AS" to a local drive and then opening it. The "save as" worked alright, but when opeing the file I got the same errors.

Oddly enough, if I navigated to the location where the MS office report.vi saved the .doc file and then opened the file, everything worked as expected. The file opened and the bookmarks were filled in as expected.

It seems to me that Outlook (exchange server) is doing something to the file (freakin Microsoft). I can't imagine, however, that I'm the first to attach a file to an email using the MS office toolkit.

Somebody please shed some light on this. It's driving me nuts.

thanks,

todd
0 Kudos
Message 1 of 7
(4,430 Views)
Hi Todd,

Try running the attached example code and see if you still get the same problem. This example uses Word Send Document VI if the default email application is MS Outlook, or SMTP Email Send File VI otherwise (make sure to change your SMTP server address in the block diagram for this option).

Good luck and have a great day!
Shakhina Pulatova
Applications Engineering
National Instruments
0 Kudos
Message 2 of 7
(4,409 Views)
Shakhina,

Thanks for your response and sorry it took so long to get back to you.

I've tried your example at home (Outlook express) and at work (Outlook). Neither worked when using SMTP email. The error message that your example returns is: "Generate Report Get Data to Modify.vi"Object 0x94400000 is not valid.

The attachment works as expected when using the Word Send document vi. However, a routing slip gets attached to the attachment. I've yet to figure out how the routing slip geta attached to the Word document or how to get rid of it.

Back to the SMTP vi's. I'm fairly confident that Outlook is the root cause of the problem. Although the attchment cannot be opened with MS Word, it can be opened with Word Pad. Opening the document with Word Pad reveals alot of extra characters throughout the document. I can send you an example if you wish.


thanks again,

Todd Curtis
0 Kudos
Message 3 of 7
(4,392 Views)
Hey Todd,

Send the file as a binary file by attaching a Boolean TRUE to the "binary?" connector.

This should make it work!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 4 of 7
(4,372 Views)
Hi Philip,

I have the same problem, but would like the code in version 7.0.

Could you please send your emailing_reports VIs in version 7.0?

Many thanks

Ma
0 Kudos
Message 5 of 7
(4,245 Views)
Hi Ma,

Here's the "Emailing_Reports.zip" including the VI for LabVIEW 7.0.

Please notice that the option of setting the "binary?" connector to TRUE, is specific to the "SMTP Email Send File.vi" and not just to this example.

Good luck!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 6 of 7
(4,226 Views)
You are a champion!
0 Kudos
Message 7 of 7
(3,744 Views)