SendEmail Message
CRM 1.2
![]() |
Sends an e-mail message.
The relevant classes are specified in the following table.
| Type | Class |
| Request | SendEmailRequest |
| Response | SendEmailResponse |
| Entity |
Remarks
To perform this action, the caller must have access rights on the e-mail entity instance. For a list of required privileges, see SendEmail Privileges.
Example
[C#]
// Standard CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
CrmService service = new CrmService();
service.Credentials =
System.Net.CredentialCache.DefaultCredentials;
// Get the ID of the system user.
WhoAmIRequest userRequest = new WhoAmIRequest();
WhoAmIResponse user =
(WhoAmIResponse) service.Execute(userRequest);
// Specify the system user who is sending the message.
service.CallerIdValue = new CallerId();
service.CallerIdValue.CallerGuid = user.UserId;
// Create a SendEmail request.
SendEmailRequest req = new SendEmailRequest();
req.EmailId = new Guid("A0F2D8FE-6468-DA11-B748-000D9DD8CDAC");
req.TrackingToken = "";
req.IssueSend = true;
// Send the email message.
SendEmailResponse res = (SendEmailResponse)service.Execute(req);
[Visual Basic .NET]
' Standard CRM Service Setup
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials
' Get the ID of the system user.
Dim userRequest As WhoAmIRequest = New WhoAmIRequest
Dim user As WhoAmIResponse =
CType(service.Execute(userRequest), WhoAmIResponse)
' Specify the system user who is sending the message.
service.CallerIdValue = New CallerId
service.CallerIdValue.CallerGuid = user.UserId
' Create a SendEmail request.
Dim req As SendEmailRequest = New SendEmailRequest
req.EmailId = New Guid("A0F2D8FE-6468-DA11-B748-000D9DD8CDAC")
req.TrackingToken = ""
req.IssueSend = True
' Send the email message.
Dim res As SendEmailResponse =
CType(service.Execute(req), SendEmailResponse)
Related Topics
© 2007 Microsoft Corporation. All rights reserved.

