Function |
Description |
---|---|
Returns the local network name |
|
Sends a e-mail message to an 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, user name, and password to use
E-mail address of sender
Comma-separated list of recipients
Subject of the e-mail message
Content of the e-mail message
uSMTP("Just a mail")uSMTP("Testmail!", "Just a mail")
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.
If 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