Create and send Email in MSCRM

How to create and send Email in MSCRM through Plugin using C#

private void SendEmail(IOrganizationService service, Guid recieverUserId, Guid senderUserId, Guid regardingObjectId, Guid TemplateId, string sender)
{
    try
    {
        //EventLog.WriteEntry("Application", "in send email plugin");
        Entity email = new Entity();
        email.LogicalName = "email";

        //Set regarding object property (i.e. The entity record, which u want this email associated with)

        EntityReference regardingObject = new EntityReference("incident", regardingObjectId);
        email.Attributes.Add("regardingobjectid", regardingObject);

        //Defining Activity Parties (starts)
        EntityReference to = new EntityReference("contact", recieverUserId);
        //Derive to party

        Entity toParty = new Entity("activityparty");

        EntityReference from = new EntityReference("queue", senderUserId);
        if (!string.IsNullOrEmpty(sender))
        {
            toParty.Attributes.Add("addressused", sender);
        }
        else
            toParty.Attributes.Add("partyid", to);

        //Derive from party

        Entity fromParty = new Entity("activityparty");
        fromParty.Attributes.Add("partyid", from);

        //Derive to party
        EntityCollection collToParty = new EntityCollection();
        collToParty.EntityName = "contact";
        collToParty.Entities.Add(toParty);

        EntityCollection collFromParty = new EntityCollection();
        collFromParty.EntityName = "queue";
        collFromParty.Entities.Add(fromParty);

        email.Attributes.Add("from", collFromParty);
        email.Attributes.Add("to", collToParty);

        //Defining Activity Parties (ends)

        //Set subject & body properties
        email.Attributes.Add("subject", "Auto Acknowledgment");
        email.Attributes.Add("description", "DO NOT REPLY TO THIS EMAIL...");
        email.Attributes.Add("directioncode", true);
        //Create email activity

        // Guid emailID = service.Create(email);

        //Sending email

        SendEmailFromTemplateRequest reqSendEmail = new SendEmailFromTemplateRequest();
        // reqSendEmail.EmailId = emailID;//ID of created mail
        reqSendEmail.Target = email;
        GetTrackingTokenEmailRequest jj_GetTrackingTokenEmailRequest = new GetTrackingTokenEmailRequest();

        GetTrackingTokenEmailResponse jj_GetTrackingTokenEmailResponse = null;

        jj_GetTrackingTokenEmailResponse = (GetTrackingTokenEmailResponse)service.Execute(jj_GetTrackingTokenEmailRequest);
        reqSendEmail.TemplateId = TemplateId;
        reqSendEmail.RegardingId = regardingObjectId;
        reqSendEmail.RegardingType = "incident";

        SendEmailFromTemplateResponse res = (SendEmailFromTemplateResponse)service.Execute(reqSendEmail);

    }

    catch (Exception ex)
    {

        throw new InvalidPluginExecutionException("An error occured in the Plugin.", ex);
    }

}