Creating a SendEmail activity

In this task we are going to create an activity that can send an e-mail message to a target user.

How to do it...

  1. Create the SendEmail activity:

    Add a new code file to the ActivityLibrary project named SendEmail.cs. Then, replace all code that is created by default with the following code:

    using System.Activities; public sealed class SendEmailActivity : CodeActivity { public InArgument<string> from { get; set; } public InArgument<string> host { get; set; } public InArgument<string> userName { get; set; } public InArgument<string> password { get; set; } public InArgument<string> to { get; set; } public InArgument<string> subject { get; set; } public InArgument<string> body { get; set; } public OutArgument<string> result ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.