• Sending emails with attachments or embedded image using Amazon's AWS SES API & .NET.

    To send an email with AWS services, there are two options, either connecting directly to the AWS SMTP server with SMTP protocols, but then you have to open SMTP ports (587 or 25 usually). Otherwise you can use the AWS API which are bunch of REST API services that you can call them over HTTPS.
    AWS SES API has two options to send emails as described in the documentation:

    1. Send simple formatted email:
      which will make your life easy, but you are limited to send only text messages.
    2. Send raw email in order to send an embedded image or more complicated content.

    In order to send raw email with embedded images, you can just find some code on stackoverflow, but I will try in this post to describe what is going on, and how raw email works, so you can understand the process in details.

    read more ...
    Everything you need to know about Date-Time in Asp.NET & JSON.

    Date-Time data type is a complex issue. Complex enough to make you confuse overtime you are writing code that return dates from the web server to the browser.
    ASP.NET MVC 5 and Web API 2 serialize dates differently, which might create more confusion for developers who are using both serializations in one web application.
    I am trying to cover everything you need to know about Date and Date serialization to JSON, in ASP.NET, and what issues are related to them.
    I wanted to cover as well the issues with JavaScript date data type, but I will leave that to another post, because there are tons of issues that can be covered when it comes to JavaScript and date.

    read more ...
    The advantages of IHttpActionResult in Web API 2.

    Web API 2 introduced the new interface IHttpActionResult to return back REST responses, where Web API 1 was using the class HttpResponseMessage to represent HTTP response, and HTTPResponseException to represent HTTP response error.

    IHttpActionResult allows developers to enhance their Web API 1 code to be :

    1. More testable.
    2. More reusable.
    3. Cleaner, and more elegant.

    We are going to unleash the potential of this interface and see some creative ideas on how to use it.

    read more ...
    Consuming a HttpClient from a web page
    HttpClient was introduced in .NET 4.5 in order to send HTTP requests.
    It is using the new Asynchronous framework in .NET 4.5.

    read more ...
    Call WCF Post REST Service from Fiddler
    Let's try to call a post REST WCF service from Fiddler. Starting from the WCF Service definition

    read more ...
    Deploy ASP.NET web site with Wix Tools

    As usual, I am going to jump immediately to the code.
    You need first Wix Microsoft Installer tools which you can download it from here.

    read more ...