Network

Function

Description

uHostname

Returns the local network name

uSMTP

Sends a mail to a SMTP server




uHostname

Description

Returns the local network name

Syntax

string uHostname()

Examples

Example 1

uHostname()  // returns something like “pollux” or “castor”



uSMTP

Description

Sends a mail to a SMTP server

Syntax

bool uSMTP(serverURL, sender, recipients, subject, body)
bool uSMTP(sender, recipients, subject, body)
bool uSMTP(recipients, subject, body)bool uSMTP(subject, body)
bool uSMTP(body)

Parameters

string serverURL

URL for specifying the SMTP server, port, username and password to use

string sender

Email address of sender.

string recipients

Comma separated list of recipients

string subject

Subject of the mail message

string body

The content of the email message

Examples

Example 1

uSMTP("Just a mail")uSMTP("Testmail!", "Just a mail")

Usage

The uSMTP function allows sending emails to multiple recipients using a SMTP server.


Specifying the SMTP server, port, user and password

The server URL for specifying the SMTP server has the following syntax: protocol://user:password@server:port

Protocol can be one of <empty> – SMTP with SSL encryption if applicable

SMTP – SMTP without SSL encryption

SMTPS – SMTP with SSL encryption

User and Password – Username and Password will be used in order to authenticate the client. If not provided, no authentication will be made.

NoteIf the username contains a @ sign, you have to replace it with # to avoid ambiguities.

Port – The TCP port to be used, default is 25.

URL Examples

myServer
myServer:123
SMTPS://myServer:123
Me:secret@myServer

Specifying recipients – You can add a list of addresses separated by a comma. By default, all recipients are addressed directly. In order to specify a CC or BC just prefix the mail address.

user@host.domain
My Name <user@host.domain>
To: My Name <user@host.domain>
To: user@host.domain
Cc: My Name <user@host.domain>
To: user@host.domain, Bcc: Test User <test@myserver.com>

Security – If the SMTP server allows communicating using an encrypted connection, this will be done automatically. If username and password is provided, authentication methods are tried in the following sequence: PLAIN, LOGIN.

Custom Defaults – You can specify your personal defaults in the INI file.

[SMTP]
ServerURL=<your default server URL>
Sender=<your default sender>
Recipients=<your default recipients>
Subject=<your default subject>

INI File Example:

[SMTP]
ServerURL=maxm:secret@mail.gmail.com
Sender= Maxi <Max.Mustermann@ gmail.com>
Recipients=ETLAdmin@MyCompany.com, Cc: QA qa@MyCompany.com
Subject=ETL Message