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)
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
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>
[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