O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required