mirror of https://github.com/arendst/Tasmota.git
sendmail
parent
f31f946a36
commit
b9acfef2ca
|
@ -24,7 +24,7 @@ USE_SCRIPT_SUB_COMMAND | enables invoking named script subroutines via the Conso
|
|||
USE_SCRIPT_HUE | enable `>H` section (Alexa Hue emulation)
|
||||
USE_SCRIPT_STATUS | enable `>U` section (receive JSON payloads)
|
||||
SUPPORT_MQTT_EVENT | enables support for subscribe unsubscribe
|
||||
USE_SENDMAIL | enables support for sending e-mail and enables the `>m` section
|
||||
USE_SENDMAIL | enable `>m` section and support for sending e-mail
|
||||
USE_SCRIPT_WEB_DISPLAY | enable `>W` section (modify web UI)
|
||||
USE_TOUCH_BUTTONS | enable virtual touch button support with touch displays
|
||||
USE_WEBSEND_RESPONSE | enable receiving the response of a [`WebSend`](Commands#websend) command (received in section E)
|
||||
|
@ -69,6 +69,7 @@ To save code space almost no error messages are provided. However it is taken ca
|
|||
- The script itself can't be specified because the size would not fit the MQTT buffers
|
||||
|
||||
**Script Sections**
|
||||
_Section descriptors (e.g., `>E`) are **case sensitive**_
|
||||
>`>D ssize`
|
||||
ssize = optional max string size (default=19)
|
||||
define and init variables here, must be the first section, no other code allowed
|
||||
|
@ -85,7 +86,7 @@ To save code space almost no error messages are provided. However it is taken ca
|
|||
Memory is dynamically allocated as a result of the D section.
|
||||
Copying a string to a number or reverse is supported
|
||||
|
||||
>`>B` _(note upper case)_
|
||||
>`>B`
|
||||
executed on BOOT time and on save script
|
||||
|
||||
>`>E`
|
||||
|
@ -343,9 +344,13 @@ if ((a==b) and ((c==d) or (c==e)) and (s!="x"))
|
|||
|
||||
**E-mail**
|
||||
`#define USE_SENDMAIL`
|
||||
(this also enables TLS as sendmail uses SSL)
|
||||
Enabling this feature also enables [Tasmota TLS](TLS) as `sendmail` uses SSL.
|
||||
|
||||
`sendmail [server:port:user:passwd:from:to:subject] msg`
|
||||
|
||||
Example:
|
||||
`sendmail [smtp.gmail.com:465:user:passwd:sender@gmail.com:rec@gmail.com:alarm] %string%`
|
||||
|
||||
The following parameters can be specified during compilation via `#define` directives in `user_config_override.h`:
|
||||
* `EMAIL_SERVER`
|
||||
* `EMAIL_PORT`
|
||||
|
@ -353,32 +358,12 @@ The following parameters can be specified during compilation via `#define` direc
|
|||
* `EMAIL_PASSWORD`
|
||||
* `EMAIL_FROM`
|
||||
|
||||
To use any of these values, pass an `*` as its corresponding argument placeholder. For example:
|
||||
`sendmail [*:*:*:*:*:to:subject] msg`
|
||||
|
||||
if msg is a `*` character you may specify the email body in the >m section (must end with an `#` character)
|
||||
|
||||
To use any of these values, pass an `*` as its corresponding argument placeholder.
|
||||
Example:
|
||||
\>D 25
|
||||
day1=0
|
||||
et=0
|
||||
to="\<mrx@gmail.com\>"
|
||||
`sendmail [*:*:*:*:*:rec@gmail.com:theSubject] theMessage`
|
||||
|
||||
\>T
|
||||
et=ENERGY#Total
|
||||
|
||||
\>S
|
||||
; send on midnight
|
||||
day1=day
|
||||
if chg[day1]>0
|
||||
then
|
||||
`=>sendmail [*:*:*:*:*:%to%:energy report]*`
|
||||
endif
|
||||
|
||||
\>b
|
||||
email report at %tstamp%
|
||||
your power consumption today was %et% KWh
|
||||
\#
|
||||
Instead of passing the `msg` as a string constant, the body of the e-mail message may also be composed using the script `>m` _(note lower case)_ section. The specified text in this script section must end with an `#` character. `sendmail` will use the `>m` section if `*` is passed as the `msg` parameter.
|
||||
[Example](Script-Cookbook#Send-e-mail)
|
||||
|
||||
**Subscribe, Unsubscribe**
|
||||
`#define SUPPORT_MQTT_EVENT`
|
||||
|
|
Loading…
Reference in New Issue