sendEmail requires that the email settings (SMTP server etc) are filled out on the settings dialog.
network.sendEmail( to, from, subject, plainBody, htmlBody, callback )
recipient for example firstname.lastname@example.org.
Subject of the email.
The plain text email body. Note that either plainBody or htmlBody or both must be provided. If you wish not to provide either plain or html place an empty string in place.
The HTML text email body.
The callback is called after email was successfully sent. Note this does not mean the email was successfully received.
function ( success )
Set to true if email was sent successfully, false otherwise.
local body = [[
Can we get another good deal on the 432,312,364
Girder Pro licenses we need this year? Can you
deliver these as CD's so we can put them under
the trees of all the good home automation fans?
network.sendEmail( "email@example.com", "firstname.lastname@example.org", "Licenses for Christmas", body, "", function(success)
if success then
print("Email send failed")
This will print