Search

SendEmail Message

Sends an e-mail message.



//# The following code shows how to use the SendEmail message.

// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0;
token.OrganizationName = "AdventureWorksCycle";

CrmService service = new CrmService();
service.Url = "http://:/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create a SendEmail request.
SendEmailRequest req = new SendEmailRequest();
req.EmailId = new Guid("A0F2D8FE-6468-DA11-B748-000D9DD8CDAC");
req.TrackingToken = "";
req.IssueSend = true;

// Send the e-mail message.
SendEmailResponse res = (SendEmailResponse)service.Execute(req);