Function |
Description |
---|---|
Returns the local network name |
|
Sends a mail to a SMTP server |
Returns the local network name
string uHostname()
uHostname() // returns something like “pollux” or “castor”
Sends a mail to a SMTP server
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)
URL for specifying the SMTP server, port, username and password to use
Email address of sender.
Comma separated list of recipients
Subject of the mail message
The content of the email message
uSMTP("Just a mail")uSMTP("Testmail!", "Just a mail")
The uSMTP function allows sending emails to multiple recipients using a SMTP server.
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.
If 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