CRMEmail.DeliverIncoming Method
The DeliverIncoming method routes the e-mail object to the appropriate set of system users or contacts.
Syntax
[Visual Basic .NET]
Public Sub DeliverIncoming(
ByVal RegardingInfo As String,
ByVal Recipients As String,
ByVal MimeMessage As String
)
[C#]
public void DeliverIncoming(
string RegardingInfo,
string Recipients,
string MimeMessage
);
[C++]
public: void DeliverIncoming(
String* RegardingInfo,
String* Recipients,
String* MimeMessage
);
Parameters
RegardingInfo
Specifies an XML string containing the regarding information.
Recipients
Specifies an XML string containing the recipients of the e-mail object.
MimeMessage
Specifies an XML string containing the MIME e-mail message.
Return Value
No return value.
Remarks
If there is an error, SOAP throws an exception and the error message is reported in System.Web.Services.Protocols.SoapException.Detail.OuterXml.
All IDs passed to the platform are GUIDs wrapped in braces. For example: {6522D89A-A752-4455-A2B0-51494C6957C3}
Example
[C#]
// strServer should be set with the name of the platform Web server
string strServer = "myservername";
// virtualDirectory should be set with the name of the Microsoft CRM
// virtual directory on the platform Web server
string virtualDirectory = "mscrmservices";
string strDir = "https://" + strServer + "/" + virtualDirectory + "/";
// BizUser proxy object
Microsoft.CRM.Proxy.BizUser bizUser = new Microsoft.CRM.Proxy.BizUser ();
bizUser.Credentials = System.Net.CredentialCache.DefaultCredentials;
bizUser.Url = strDir + "BizUser.srf";
// CRMEmail proxy object
Microsoft.CRM.Proxy.CRMEmail email = new Microsoft.CRM.Proxy.CRMEmail();
email.Credentials = System.Net.CredentialCache.DefaultCredentials;
email.Url = strDir + "CRMEmail.srf";
string strErrorMsg;
string strRegInfo = "Test delivery of e-mail";
string strMailBody = "This is the e-mail body contents.";
string strEmailAddress = "luis@adventure-works.com";
try
{
Microsoft.CRM.Proxy.CUserAuth userAuth = bizUser.WhoAmI();
// Deliver the incoming e-mail
email.DeliverIncoming(strRegInfo, strEmailAddress, strMailBody);
}
catch (System.Web.Services.Protocols.SoapException err)
{
// Process the platform error here
strErrorMsg = ("ErrorMessage: " + err.Message + " " + err.Detail.OuterXml + " Source: " + err.Source );
}
catch (Exception err)
{
// Process other errors here
strErrorMsg = ("ErrorMessage: " + err.Message );
}
Requirements
Namespace: Microsoft.CRM.Proxy
Assembly: microsoft.crm.proxy.dll
See Also