22.10.2017, 18:24
Something like below:
Code:
-- Download an image from camera
require('socket.http')
image = socket.http.request('http://192.168.2.10/cgi-bin/snapshot.cgi?chn=1&u=admin&p=password')
to = 'example@gmail.com'
subject = 'Snapshot from camera'
message = 'This is the message from your LM with the snapshot from camera.'
files = {{filename='Snapshot.jpg', filedata=image, mimetype='jpg'}}
-- Send an email
mailattach(to, subject, message, files)