How to - Best practice

The requirements and the solutions will be listed in this area to simplify the handling with TwinCAT SMTP.

Sending attachments

Use the function block FB_SmtpV3_Full and pass the file path at input sAttachments.

How to - Best practice 1:

Note the different path specifications of Windows and Windows CE.

Windows:

sAttachments: ARRAY [0..32] OF STRING := 'C:\Data.csv', 'C:\Config.xml';

Windows CE:

sAttachments: ARRAY [0..32] OF STRING := '\Hard Disk\Data.csv', '\Hard Disk\Config.xml';

Encrypt mails

Encrypt mails

Use the function block FB_SmtpV3 or FB_SmtpV3_Full and activate the encryption via  nEncryption input.

0 = NONE

1 = STARTTLS

2 = SSL

Send to several recipients

Send to several recipients

Use the function block FB_SmtpV3 or FB_SmtpV3_Full and separate the addresses (To, Cc, Bcc) via commas.

sTo:= 'service@customer.com, support@integrator.com';

Send mails via CX9000

Send mails via CX9000

The CX9000 is only available with a LF-image (Low-Footprint), which  is only supported till version 1.0.13.

Troubleshoot

Troubleshoot

Please check our trouble shooting article.