Network

Function

Description

uHostname

Returns the local network name

uSMTP

Sends a e-mail message to an 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, user name, and password to use

string sender

E-mail address of sender

string recipients

Comma-separated list of recipients

string subject

Subject of the e-mail message

string body

Content of the e-mail message

Examples

Example 1

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

Usage

The uSMTP function allows e-mail messages to be sent to multiple recipients using a SMTP server.

The server URL for specifying the SMTP server uses this 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 name and password – The user name and password are used to authenticate the client. If not provided, no authentication is performed.

NoteIf the user name contains a @ sign, replace it with # to avoid ambiguities.

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

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

Specify recipients by adding a list of addresses separated by a comma. By default, all recipients are addressed directly. To send a carbon copy or blind carbon copy, simply add "cc:" or "bcc:" before the e-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>

If the SMTP server allows encrypted communication, it is performed automatically. If you provide user name and password, authentication methods are tried in the following sequence: PLAIN, LOGIN.

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>

For 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