GithubHelp home page GithubHelp logo

t0mburton / fluentemail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukencode/fluentemail

1.0 2.0 0.0 1.37 MB

.net fluent email class

Home Page: http://lukencode.com/2011/04/30/fluent-email-now-supporting-razor-syntax-for-templates/

License: MIT License

C# 100.00%

fluentemail's Introduction

alt text

FluentEmail - All in one email sender for .NET and .NET Core

Send email from .NET or .NET Core. A bunch of useful extension packages make this dead simple and very powerful.

Packages

FluentEmail.Core - Just the domain model. Includes very basic defaults, but is also included with every other package here.

FluentEmail.Smtp - Now we're talking. Send emails via SMTP. At the moment, only works on .NET 4.

FluentEmail.Razor - Generate emails using Razor templates. Anything you can do in ASP.NET is possible here. Uses the RazorLight project under the hood.

FluentEmail.Mailgun - Send emails via MailGun's REST API. Works with .NET Core :)

Usage

You can choose which renderer and sender you would like to use, or build your own inheriting from ITemplateRenderer and ISender.

Example usage from:

var email = Email
    	.From("[email protected]")
    	.To("[email protected]", "bob")
    	.Subject("hows it going bob")
    	.Body("yo dawg, sup?");

Templates usage:

// Using Razor templating package
Email.DefaultRenderer = new RazorRenderer();

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

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

Sending:

// Using Smtp Sender package
Email.DefaultSender = new SmtpSender();

//send normally
email.Send();

//send asynchronously
await email.SendAsync();

http://lukencode.com/2011/04/30/fluent-email-now-supporting-razor-syntax-for-templates/

Development and Beta Packages

If you need a pre-release version, you can add the MyGet feed to your nuget package sources.
https://www.myget.org/F/fluentemail/api/v3/index.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.