().SingleOrDefault(x => x.Url == url) ??
+ new Feed {
+ Url = url
+ };
+ var isNew = !savedFeed.SentItems.Any();
+ foreach (var item in feed.Items)
+ {
+ // Ignore previously processed items
+ if (savedFeed.SentItems.Contains(item.Id))
+ continue;
+
+ // Only send an email if the url is not new or if the user configures that new urls should send all current items
+ if (!isNew || sendAllForNewFeeds)
+ {
+ try
+ {
+ var message = new MailMessage(from, to) {
+ Subject = "[New Post] " + item.Title,
+ Body = item.Content + string.Format("View the original article: {0}
", item.Link),
+ IsBodyHtml = true
+ };
+
+ var smtp = new SmtpClient();
+ smtp.Send(message);
+ }
+ catch (Exception ex)
+ {
+ // Ignore this for now... we'll just try again next time the app runs
+ continue;
+ }
+ }
+
+ savedFeed.SentItems.Add(item.Id);
+ }
+ session.Store(savedFeed);
+ session.SaveChanges();
+ }
+ }
+ }
+}
diff --git a/RssToEmail/Properties/AssemblyInfo.cs b/RssToEmail/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3cec95e
--- /dev/null
+++ b/RssToEmail/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RssToEmail")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("RssToEmail")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8ae8306a-a635-45f0-a39e-faa5afcfd9bc")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/RssToEmail/RssToEmail.csproj b/RssToEmail/RssToEmail.csproj
new file mode 100644
index 0000000..699d3c4
--- /dev/null
+++ b/RssToEmail/RssToEmail.csproj
@@ -0,0 +1,119 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {9E3553CC-2C00-4C22-BC6A-5C11FB9B0222}
+ Exe
+ Properties
+ RssToEmail
+ RssToEmail
+ v4.0
+
+
+ 512
+ ..\
+ true
+
+
+ x86
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x86
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\BouncyCastle.Crypto.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Esent.Interop.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\ICSharpCode.NRefactory.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Lucene.Net.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Lucene.Net.Contrib.Spatial.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Lucene.Net.Contrib.SpellChecker.dll
+
+
+ ..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll
+
+
+ ..\packages\qdfeed.1.0.2\lib\net35\QDFeedParser.dll
+
+
+ ..\packages\RavenDB.Client.1.2.2060-Unstable\lib\net40\Raven.Abstractions.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Raven.Backup.exe
+
+
+ ..\packages\RavenDB.Embedded.1.2.2060-Unstable\lib\net40\Raven.Client.Embedded.dll
+
+
+ ..\packages\RavenDB.Client.1.2.2060-Unstable\lib\net40\Raven.Client.Lightweight.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Raven.Database.dll
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Raven.Smuggler.exe
+
+
+ ..\packages\RavenDB.Database.1.2.2060-Unstable\lib\net40\Spatial4n.Core.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Raven.Studio.xap
+ PreserveNewest
+
+
+
+
+
+
\ No newline at end of file
diff --git a/RssToEmail/packages.config b/RssToEmail/packages.config
new file mode 100644
index 0000000..310b017
--- /dev/null
+++ b/RssToEmail/packages.config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file