This example program shows how to send email from LabVIEW using GMAIL servers, and can be easily modified for other SMTP servers requiring TLS or SSL authentication.
Often times, it is useful to have LabVIEW send email (for example, to notify an administrator when an event has occurred). To do so, LabVIEW features built-in SMTP functions. Unfortunately, however, these functions do not currently support sending mail through SMTP servers that require authentication (such as TLS or SSL).
In modern times, nearly all email services require authentication. This holds true for the popular free GMAIL™ service provided by Google Inc., presenting a challenge for users who wish to access these services from LabVIEW.
Microsoft's .NET Framework, on the other hand, does support sending SSL and TSL authenticated email (such as that required by GMAIL™), which can be accessed using LabVIEW's .NET Constructor Nodes. The attached example program demonstrates how this is accomplished; it has been tested and pre-configured with GMAIL™ in mind; however. it should also work with other authenticated servers.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.