When you distribute e-mail activities for a campaign in Microsoft Dynamics CRM, the e-mail activities are not automatically sent
to the recipients. Instead, you have to open each e-mail activity. Then, you
have to send each e-mail activity manually.
This problem is fixed in Microsoft Dynamics CRM 3.0 Update Rollup 1.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
922815
(http://support.microsoft.com/kb/922815/
)
Update Rollup 1 for Microsoft Dynamics CRM 3.0 is available
This problem is fixed in Update Rollup 1 for Microsoft Dynamics CRM 3.0 Professional Edition for Service Providers.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
935731
(http://support.microsoft.com/kb/935731/
)
Update Rollup 1 for Microsoft Dynamics CRM 3.0 Professional Edition for Service Providers is available
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756
(http://support.microsoft.com/kb/322756/
)
How to back up and restore the registry in Windows
After you install this update rollup, create a registry
entry on the Microsoft Dynamics CRM server that is named CampaignSendEmail. To do this, follow these steps:
Click Start, click Run,
type regedit, and then click
OK.
In Registry Editor, locate the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM
Create the registry entry. To do this, follow these steps:
Right-click MSCRM, point to
New, and then click DWORD Value.
In the Name field, type
CampaignSendEmail.
Double-click this registry entry, and then type
1 in the Value field.
Note If you type 1 in the Value field, CRM will
automatically send e-mail activities for a campaign.
If you type 0 in the Value field, CRM will not automatically
send e-mail created from the campaign
To work around this problem instead of installing this
hotfix, create a Workflow .NET assembly to send e-mail activities
automatically.
Note Microsoft CRM 3.0 does not support any .NET assemblies for which
the following conditions are true:
You created the .NET assembly by using Microsoft Visual
Studio .NET 2005 and the .NET Framework version 2.0.
You intend to use the .NET assembly as a Callout assembly
or as a Workflow assembly.
To create a Workflow .NET assembly, follow these steps:
Create a new bit-type field on the Microsoft CRM E-mail
form to specify that the e-mail activity is for a campaign:
In Microsoft CRM, click GoTo, point to
Settings, click Customization, click
Customize Entities, click E-mail, click
More Actions, and then click Edit.
Click Attributes, and then click
New.
In the Display Name field, type a
name. This example uses the name "Campaign E-mail."
In the Type list, click
bit.
In the Default Value list, click
No, and then click Save and Close.
Click Forms and Views.
Click Form, click More
Actions, and then click Edit.
Click Add Fields, click the new field
that you created, click OK, and then click Save and
Close.
In the E-mail Entity window, click
Actions, click Publish, and then click
Save and Close.
Create a .NET assembly to send the e-mail activities. The
following steps create a new class library that is named AutoSend by using Microsoft Visual Studio .NET 2003:
Start Visual Studio .NET 2003, and then click
New Project.
Click Visual C# Projects, click
Class Library, type AutoSend for the
name, and then click OK.
In Solution Explorer, right-click
References, and then click Add Web
Reference.
In the URL field, type the path of the
Crmservice.asmx file. In the following example, localhost:5555 is a placeholder for the name of the Microsoft CRM Web site:
Change the value in the Web reference
name field to CrmSdk.
Click Add Reference.
Add the following using statement.
using AutoSend.CrmSdk;
Create a public method that accepts a Guid parameter for the ActivityId field of the e-mail.
Note You must replace the GUID value that is specified in the service.CallerIdValue.CallerGuid line with the GUID value in the SystemUserId field of a user from
the Microsoft CRM system who has the appropriate permissions to send e-mail
activities.
You can use the Fetch method to retrieve this user. Your method will resemble
the following.
public void SendEmail(Guid campaignActivityID)
{
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.CallerIdValue = new CallerId();
// Replace the GUID with the GUID of
the Microsoft CRM Administrator.
service.CallerIdValue.CallerGuid = new
Guid("FD80F8E8-C852-DA11-B1FB-0007E94D105B");
SendEmailRequest req = new SendEmailRequest();
req.EmailId = campaignActivityID;
req.TrackingToken = "";
req.IssueSend = true;
try
{
SendEmailResponse res = (SendEmailResponse)service.Execute(req);
}
catch (System.Web.Services.Protocols.SoapException er)
{
// Process any error messages here.
}
}
After you change the service.CallerIdValue.CallerGuid line, click Build, and then click Build
Solution.
Copy the newly created AutoSend.dll file that is in
the Bin\Debug folder of your solution to the following folder:
Program Files\Microsoft CRM\Server\Bin\Assembly
Add the assembly information to the Workflow.config file:
Click Start, point to
Programs, point to Administrative Tools, and
then click Services.
In the Services window, right-click Microsoft
CRM Workflow Service, and then click Stop.
Locate the Workflow.config file, and then open this
file in Notepad. By default, the path is as follows:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This problem was corrected in Microsoft Dynamics CRM 3.0 Update Rollup 1 and in Update Rollup 1 for Microsoft Dynamics CRM 3.0 Professional Edition for Service Providers.