LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send email on labview using the Gmail Server (TLS)


tca-adam wrote:

....

Any clues to what this could be? I was wondering if it had to do with the NET references not being closed as someone else had stated earlier in this thread.

 

thanks.


Yes, I assume that not closing the refnums will cause this.

Have you tried closing the refereces?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 21 of 114
(4,703 Views)

tca-adam,

 

        I concur with TonP. It sounds like there is a reference left open somewhere. I would suggest stepping through your code with Highlight Execution on and see where the code breaks then look around that area.

 

0 Kudos
Message 22 of 114
(4,687 Views)

The VI as it is, runs fine.

 

Where the problem happens is when you loop it, as it appears to keep the file open that you have used as an attachment.

 

eg I want to record data every 5 mins and then once an hour email the results saved in a spreadsheet file. First iteration works fine, then after that I get this error:

 

Error 5 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (DBL).vi->gmail loop.vi

Possible reason(s):

LabVIEW:  File already open.

C:\Temp\atw.txt

 

Error 1172 occurred at Constructor Node in Gmail.vi->gmail loop.vi

Possible reason(s):

LabVIEW:  A .NET exception occurred.

 

There appears to be a number of .NET references open in this VI (eg MailAddress, MailMessage, Attachment, AttachmentCollection etc). Do I need to close all these references, or can I close just one to cover them all?

 

 

 

 

 

Message Edited by tca-adam on 12-02-2008 11:11 AM
0 Kudos
Message 23 of 114
(4,676 Views)

tca-adam wrote:

There appears to be a number of .NET references open in this VI (eg MailAddress, MailMessage, Attachment, AttachmentCollection etc). Do I need to close all these references, or can I close just one to cover them all?Message Edited by tca-adam on 12-02-2008 11:11 AM


Yes, close them all in reverse order, first close the reference last opened.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 24 of 114
(4,665 Views)
Yes..  I threw that example together rather hurredly when I made it.  I believe that LaVIEW automatically closes the .NET references when the program completes, but if you wanted to run it in a loop than you would need to close them manually (ie: in code).
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 25 of 114
(4,658 Views)

Eriquito wrote:
Yes..  I threw that example together rather hurredly when I made it.  I believe that LaVIEW automatically closes the .NET references when the program completes,

LabVIEW will close those references once the VI (or even LabVIEW) is fully removed from memory...

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 26 of 114
(4,650 Views)
Hi, Every one, Just another question, I once use this program to send mail to multi-person, but it doesn't work, USE ":" will feedback" Inner Exception: System.ArgumentNullException: Value cannot be null. Parameter name: message“ If only use ”,“ it will only send the mail to the first person, How do i deal with it?
0 Kudos
Message 27 of 114
(4,626 Views)

You can send to multiple "To" recipients by using MailMessage(String from, String to) instead of MailMessage().  You can then comma separate the addresses. 

 

Download All
0 Kudos
Message 28 of 114
(4,618 Views)

Has anyone had any luck closing the appropriate references so that you can access an attachement file after the email is sent?  I've tried closing the references but must be doing something wrong...I still can't move the file after it's been accessed by the VI...the system thinks it's still in use. 

 

 

0 Kudos
Message 29 of 114
(4,537 Views)

Minitor,

 

When you embed images in your e-mail, you must actually attach the images then submit the e-mail.  Then you can go back and edit the message and insert the images into the body of the message.  As you have it now, your images are pointing to a temporary location on the NI website which was created when you previewed your e-mail.  You must submit the message first so that you can get the permanent message ID number on the website.  Then when you insert the images after that, they links point to the permanent location on the NI website.

0 Kudos
Message 30 of 114
(4,531 Views)