Send a Custom E-mail for a Campaign Activity

The following sample shows how to send an e-mail for a campaign activity.



[C#]
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 your Microsoft Dynamics 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.
}
}