Quickstart Guide
Introduction RIO Academic RIO Application examples Your first RT app Your first FPGA app
Basic procedures System admin File system I/O monitor System controller architecture Timed loops Inter-process communication RT/Host communication RT/FPGA communication FPGA personalities Interrupts Datalogger (file I/O)
Design flow Simulation Inter-process communication RT/host communication Derived clock domain IP blocks FPGA personality
Get connected Email Web services UDP TCP IP addresses
Site Map
Guides Code examples Procedures Tags LabVIEW block diagram elements Targets Communications All pages
Glossary How to use About
RIO Developer Essentials Guide for Academia
RT code example

Send a file as an email attachment with high priority (remote webcam photo logger application)

Use the low-level Simple Mail Transport Protocol (SMTP) VIs create an email, attach a file, and set the email header to flag the message as 'high priority' in the recipient's email application. The illustrative application example captures webcam images at regular intervals and sends them as email attachments.

LabVIEW RT block diagram snippet: RT opens a handle to SMTP email session, sets recipients, message, attachments, and headers, then sends the email message

Use cases


Keep in mind

IMPORTANT: The Academic RIO Device system date must be reasonably close to the true date for TLS-secured email to be accepted by the SMTP server. Experiments with the Gmail SMTP server show that the Device system date must be no more than 12 days in the past and no more than 70 days into the future. The Device does not include an onboard real-time clock (RTC), therefore its system date resets to the same date on each power cycle. While it is possible to occasionally manually update the power-on system date (see below), consider the inexpensive Digilent I2C battery-backed RTC module to preserve the true calendar date across power cycles.

You can adjust the power-on system date with NI MAX or a browser.

LabVIEW block diagram elements

Locate these elements with "Quick Drop" (press Ctrl+Space and start typing the name); click on an icon to see more sample code that uses that element:

Open Handle
Set Recipients
Set Message
Set Attachments
Set Headers
Close Handle
Create Timer Interrupt
Destroy Timer Interrupt
Callback VI Reference
Vision Acquisition
Get Date-Time In Seconds
Format Date-Time String
Get Date-Time String

Example code

CAUTION: This VI stores your Google account credentials – keep this in mind when posting or sharing your code!

Troubleshooting tips

Expected results

https://youtu.be/5kkb8nAQ4tU (5:02)

Developer walk-through

https://youtu.be/SQDgc_71tMU (8:16)