I've put together a simple plugin that will email the captured image after motion is detected. It has a user defined inactivity period where captured images are ignored, to avoid flooding the SMTP server with images.
After Jon graciously provided the source code to the app, I modified his code to allow plugins. I offered Jon that code so he can add it into his distribution, but if he decides against that, you can PM me and I will give you the modifications.
The code for the plugin is below, just place the file in the plugins folder (underneath folder containing the EXE) and compile with:
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\csc /target:library EmailImage.cs /r:..\\"Motion Monitor.exe"
EmailImage.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;
public class EmailImage : MotionMonitor.IPlugin
{
DateTime LastTime;
public string AppName
{
get { return "Email Image Plugin"; }
}
public string AppDesc
{
get { return "This plugin sends captured image to SMTP server."; }
}
public string AppVer
{
get { return "1.0"; }
}
public void MotionDetected(string filename)
{
if (DateTime.Now > LastTime.AddMinutes(5))
{
SmtpClient smtp = new SmtpClient();
smtp.Host = "localhost";
smtp.Credentials = new NetworkCredential("user", "pass");
MailMessage msg = new MailMessage("user@domain", "user@domain",
"Motion Detected", "This picture was taken after motion was detected");
msg.Attachments.Add(new Attachment(filename));
smtp.Send(msg);
LastTime = DateTime.Now;
}
}
}