LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EXE file with STMP mail

Hi guys,
 
I ran into a problem that I don't understand and I would really appreciate someone's expertises getting in.
 
I've developed a VI (let's call it a 'Main.VI') that has more than 100 subVIs. Among the subVIs, there are numerous 'STMP Email Send Message.VI's.  What this whole program does is that it first reads raw data from a data logger, goes through a data processing/reduction program, saves reduced data into a folder, and then sends only reduced data files to the users on timely basis (e.g. every hour, once a day, once a week...) - this is where 'STMP email send message.VI' comes in play.
 
I plan on running this 'Main.VI' as a service (in background). So I made an exe file out of this 'Main.VI'.  Now, here comes an odd part. Before I made a exe file, everything works fine (it saves data and send reduced files to users). However, when I make and run the exe file, the email thing does NOT work. The strange thing is that everything else works fine but I can not get the email stuff to work.
 
Does anyone have any idea why it's happening? Any suggestions?
Does Labview limit the usage of STMP email.VI when a normal VI is turned into an exe file?
0 Kudos
Message 1 of 9
(3,773 Views)
I don't think there is a problem with including SMTP functions in an exe but maybe you are having a problem with paths to the files you are trying to send? If you are using something like Current VI's Path to determine where the files are, you should know that the path is different when you build an exe. In development, you might have a path of c:\folder\example.vi and you would use a single strip path to get to the folder. When you build it, the path then becomes c:\folder\application.exe\example.vi so you would need to do an additional strip path to get to folder. You might want to add some error checking or additional indicators to see exactly why the exe is failing. If it is a path problem, a common technique to make the development and exe work the same is to add the application property 'App.Kind' to your VI. Wire the output to a case statement. If the value is 'Run Time System', then do the additional strip path.
0 Kudos
Message 2 of 9
(3,760 Views)

Thanks for your help. To anwer your question first, No I'm not using 'current vi's path'. The location of my 'Main.VI' and the file folders are different (e.g, 'C:\....\desktop\Main.VI.' and 'C:\temp\data file folder'). I will once again try to explain how the program works.

1. 'Main.VI' collects/reduces/processes raw data and save the reduced data hourly into 'data file folder'.

2. When it reaches a certain time limit (e.g. 1day, 1week, 1 month,..etc), it will send a notification to a subVI and this subVI will do some processing/saving and send a reduced file to users via email.

Again, before I make an exe file, everything works the way I programmed. After building an exe, however, everything else works fine except the email.

I included a screen shot of a portion of block diagram for this subVI. 

0 Kudos
Message 3 of 9
(3,753 Views)
It's pretty hard to tell with just a portion of your diagram in a screen shot. I do see 6 global variables in the email section and that's probably 6 too many. Unless you can post the code, my recomendation still is to place some indicators on the front panel and see if what is getting passed is what you expect and put an error indicator on the SMTP function or wire up one of the error handler functions.
0 Kudos
Message 4 of 9
(3,746 Views)
I put some indicators and I can see that all the email addresses and attached files are getting through. However, I am getting an error message(see attached) that I don't fully understand why it's happening and it's really odd because it was working before building an exe. Any idea why it's happening?
 
Thanks again for your advice. I would've been totally stuck here without your suggestions. 
0 Kudos
Message 5 of 9
(3,740 Views)

The error means "The system caused the network connection to be aborted."

I wonder if this isn't the result of some security setting on your network/mail server/firewall. Could it be blocking access from an unknown exe? The TCP open is using port 25. Are you using XP? If so, the first place I would look is in the Windows Firewall settings. Try adding your exe to the exceptions list.

Message 6 of 9
(3,727 Views)
I really hope that was the reason. I will look into that and let you know how it's going.
Thanks again for the advise.
0 Kudos
Message 7 of 9
(3,723 Views)

You were right. What's happening was that the virus scan software was blocking any unknown exe files. So, I had to go to its properties and have it exclude my exe file. Now it's working.

If I could reach you, I would buy you a lunch or something.

Thanks a million.

0 Kudos
Message 8 of 9
(3,720 Views)
Glad you go it to work. I know that security is a good thing but sometimes it just gets in the way. All of our computers are setup for automatic updates from microsoft and a recent change caused a batch file that had running for several years suddenly start to fail. It wasn't the couple of hours it took to track down the problem but the couple of days it has taken to update dozens of test systems with a work around.
0 Kudos
Message 9 of 9
(3,715 Views)