Send Email through Code using Late Bound MSCRM 2011

If you want to send mail through sdk using late bound you can use below function

 private void CreateMail(IOrganizationService service,Guid _ contactid,Guid _From)


//create activityparty

Entity Fromparty = new Entity(“activityparty”);

Entity Toparty = new Entity(“activityparty”);

 //set partyid

//You can refer to get acitivity party entity attribute

Toparty[“partyid”]= new EntityReference(“contact”, _ contactid));

 Fromparty[“partyid”]= new EntityReference(“systemuser”, _From));

//create email  and set attributes

Entity _Email = new Entity(“email”);

 _Email[“from”] = new Entity[] { Fromparty };

 _Email[“to”] = new Entity[] { Toparty };

 _Email[“directioncode”] = true;

 _Email[“regardingobjectid”] = new EntityReference(“contact”, _contactid);

  Guid EmailID = service.Create(_Email);


Enjoy !!!


Leave a comment

Filed under MS CRM 2011

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s