SMTP Email VIs

Owning Palette: Protocols VIs and Functions

Requires: Full Development System. This topic might not match its corresponding palette in LabVIEW depending on your operating system, licensed product(s), and target.

Use the SMTP Email VIs to send email, including attached data and files, using the Simple Mail Transfer Protocol (SMTP). You can use Transport Layer Security (TLS) to communicate with the SMTP server with added security. You also can specify authentication credentials for the SMTP client. However, you cannot use the SMTP Email VIs to receive information.

Note  The SMTP Email VIs use UTF-8 encoding to send email.

You can use the Send Email Express VI to quickly send emails from LabVIEW to a list of recipients you specify. However, if you want to configure headers, set TLS settings, or include an attachment, you can use the standard SMTP Email VIs to configure and send an email with more advanced settings.

The standard SMTP Email VIs use an SMTP client handle to maintain the SMTP client settings across the block diagram. You can use individual VIs to set the email configuration. Close the client handle using the Close Handle VI when you no longer need it to free system resources.

The VIs on this palette can return SMTP email reply codes.

Refer to labview\examples\Data Communication\Protocols\SMTP\Send Email using SMTP Client.vi for an example of using multiple SMTP Email VIs in a single VI to send an email.

Palette ObjectDescription
Clear AttachmentsRemoves all attachments you set using the Set Attachments VI.
Clear HeadersRemoves all headers you set using the Set Headers VI.
Close HandleCloses a connection to an SMTP server and disposes of the handle created by an Open Handle VI.
Config TLSSets the SMTP client certificate, certificate authority (CA) certificates bundle, and private key file paths for a TLS or SSL request.
Open HandleCreates a new SMTP client handle using the specified SMTP server. Use this VI with other SMTP Email VIs to send emails according to your specifications. You must close the handle using the Close Handle VI.
SendSends an email using the configuration you set on the handle wired to handle in.
Send EmailCreates and sends an email according to the settings you specify in the configuration dialog box.
Set AttachmentsSets a list of files that you want to include with the email. This VI overwrites any attachment values that you specify before this VI executes.
Set HeadersSets a list of auxiliary headers that you want to send with the email. This VI overwrites any header values that you specify before this VI executes.
Set MessageSets the message you want to include in the body of the email. This VI overwrites any message values that you specify before this VI executes.
Set RecipientsSets the list of recipients to whom you want to send the email. This VI overwrites the existing values before it executes.