Pull request Compare This branch is 5 commits ahead, 60 commits behind lukencode:master.
Latest commit c88a57d Oct 4, 2012 @lyphtec Added obsolete notice


NOTICE: This project is now obsolete

Consider using this FluentEmail.Markdown instead

Playing around with a fluent email class in c#

Example usage from:

var email = Email
        .To("bob@email.com", "bob")
        .Subject("hows it going bob")
        .Body("yo dawg, sup?");

Templates usage:

var template = "Dear @Model.Name, You are totally @Model.Compliment.";

var email = Email
    .Subject("woo nuget")
    .UsingTemplate(template, new { Name = "Luke", Compliment = "Awesome" });


//send normally

//send asynchronously

Markdown template support!

New support for using Markdown templates has been added. This uses the Markdown Razor support in ServiceStack and supports full model binding as available in standard Razor.

Example using a Markdown template:

var email = Email
    .Subject("woo nuget")
    .UsingMarkdownTemplateFromFile(@"~/test.md", new { Name = "Luke", Numbers = new string[] { "1", "2", "3" } });


# Heading 1

This is a [Markdown](http://mouapp.com) page

- one
- two
- three

You can also bind to Model

Name: @Model.Name


@foreach i in Model.Numbers {
- Number: @i

And do cool stuff like get the current date/time @DateTime.Now

This will be the rendered output (Message.Body):

<p>This is a <a href="http://mouapp.com">Markdown</a> page</p>


<p>You can also bind to Model</p>

<p>Name: LUKE</p>


<li>Number: 1</li>
<li>Number: 2</li>
<li>Number: 3</li>

<p>And do cool stuff like get the current date/time 20/04/2012 4:52:33 PM</p>