Create a new SharePoint Sequential Workflow project.
Drag and drop SendEmail activity just after onWorkflowActivated1 activity .
Set CorrelationToken property of SendEmail to workflowToken which is the workflow correlation token used by onWorkflowActivated1.
For MethodInvoking set the value sendEmail1_MethodInvoking and click which would generate the handler.
private void sendEmail1_MethodInvoking(object sender, EventArgs e)
sendEmail1.To = “myId@g.com”;
sendEmail1.From = ” myId@g.com “;
sendEmail1.CC = ” otherId@g.com “;
sendEmail1.Subject = “MySubject”;
sendEmail1.Body = ” This is test mail”;
Strong sign the assembly and install it in GAC.
Set your feature.xml as following
Description=“This feature is a workflow that …“
<ElementManifest Location=“workflow.xml“ />
Id– Provide a new guid for uniquely identifying the feature
Title – to be displayed in the list of features deployed to the site
Description – Any description that appears beneath the Title.
Location – Leave it to default as the directory is same.
Set your workflow.xml as following
Description=“This workflow …“
CodeBesideAssembly=“SharePointWorkflowLibrary3, Version=220.127.116.11, Culture=neutral, PublicKeyToken=58efe34bdb2df93e“
Name – Name of the workflow.
Description – Any description about the workflow
Id – A new guid for the workflow
CodeBesideClass – Namespace.ClassName
CodeBesideAssembly – name of assembly, version , culture and publicKeyToken which we can get by right clicking the assembly in gac and selecting properties.
Remove all other entries as we are not using any forms for this workflow.
Now modify the install.bat file as mentioned in the instruction for the same.
Next go to the site where the new workflow has been deployed.
Select any document library – than settings- document library settings – workflow settings – add a workflow.
We’ll see our workflow within the workflow template.
Correlation Token – A correlation token is essentially a means of uniquely identityfing each instance of a workflow, modification or task.