Wednesday, December 8, 2010

Send E-mail Activity Sample

Send E-mail Activity Sample: "Send E-mail Activity Sample"

Send E-mail Activity Sample
.NET Framework 3.5 Other Versions .NET Framework 3.0
Download sample


The SendEmailActivity activity can be used to send e-mail messages from a workflow through Simple Mail Transfer Protocol (SMTP). This is a basic custom activity that uses System.Net.Mail components to create and send an e-mail message at run time. The SendEmailActivity activity also demonstrates how to implement a custom Activity Designer.

The SendEmailWorkflow project contains a simple console-based application and a sequential workflow that uses the SendEmailActivity. Before the e-mail message is sent, the code in the SendEmailActivity validates that the e-mail and SMTP properties are set correctly. The SendingEmail event is raised, which prints "Preparing to send email." to the console. After the e-mail message has been sent, the SentEmail event is raised, and "The email has been sent." is printed to the console.

0 comments: