[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)