09-17-2012 10:37 AM
I need to have a cRIO send out an email every hour with a .txt file attached to it. I'm attaching code that I previously used that created a new .txt file every hour and stored it to the cRIO's hard drive. I'm wondering if it's possible to modify the code I currently have to take the data files that are being saved every hour, and then email them out after they are saved. I'm using the a naming convention of "Temps_NNN.txt" and with LabVIEW auto incrementing the file name every time a new file is created starting with "Temps_001.txt".
Thank you!
James
09-18-2012 06:49 PM
Hello James,
There are a few ways to send an email from a Real-Time controller, but the following documents may serve as starting points:
Send Email using Gmail from a LabVIEW-RT Target
Send Emails using MailGun RESTful API
Sending SMTP Email Attachments From LabVIEW
The specifics of what service and/or email provider you intend to use will impact how you can go about sending an email. For instance, any public service that relies on .NET authentication will not run "out of the box" on an RT target, and potentially not at all due to OS dependencies. You may find it easier to send the emails from a nondeterministic host VI or monitoring service. As for sending a text file attachment, it may prove easier to include the text in the body of the email itself, again this depends on what you are trying to do and what service you end up using.
My personal recommendation would be to utilize the FTP VIs that ship with LabVIEW/RT to transfer the files, either to the end target directly or to a host machine that can send emails with authentication, but again this depends on your needs and whether or not you are using a private email server or a public service such as Gmail.
Regards,