Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc. http://www.blynk.cc/
Dependents: Blynk_RBL_BLE_Nano Blynk_MicroBit Blynk_Serial Blynk_RBL_BLE_Nano
Diff: Blynk/BlynkApi.h
- Revision:
- 2:c5b857d4f9f6
- Parent:
- 0:58b20b438383
- Child:
- 7:8879692d4e6c
diff -r 401940b68eae -r c5b857d4f9f6 Blynk/BlynkApi.h --- a/Blynk/BlynkApi.h Sat May 07 08:09:44 2016 +0000 +++ b/Blynk/BlynkApi.h Fri Jun 24 00:58:58 2016 +0300 @@ -216,6 +216,21 @@ static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_EMAIL, 0, cmd.getBuffer(), cmd.getLength()-1); } + /** + * Sends an email message + * + * @param subject Subject of message + * @param msg Text of the message + */ + template <typename T1, typename T2> + void email(const T1& subject, const T2& msg) { + char mem[BLYNK_MAX_SENDBYTES]; + BlynkParam cmd(mem, 0, sizeof(mem)); + cmd.add(subject); + cmd.add(msg); + static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_EMAIL, 0, cmd.getBuffer(), cmd.getLength()-1); + } + #if defined(BLYNK_EXPERIMENTAL) // Attention! // Every function in this section may be changed, removed or renamed.