locked
Is it possible to write email address directly in the field "to" in the email activity? RRS feed

  • Question

  • Hello,

    i want to write the email address, for example, "toto@hotmail.com" in the field "to" of when i create an activity Email in CRM , but it is not allowed, i also read in the CRM Sdk and try to create an activity Email by CRM Serivice, i dont konw it is possbile or not, if it is not possible. i have to create systemusers or contact which will contain this email address.

    Does anybody konw this? thanks to all

    Wednesday, July 6, 2011 3:45 PM

Answers

All replies

  • Wednesday, July 6, 2011 4:11 PM
    Moderator
  • The person must be a contact or user in the system.  It's not a string field, it's holds activity parties which are contacts or users.


    Jamie Miley
    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, July 6, 2011 4:11 PM
    Moderator
  • Hi

    You can write the email address directly in the to field of the Email in CRM. For that you need to do the following setting.

    Settings --> Administration --> System Settings --> Email tab --> 'Set Email Form Option'

    In that set the 'Allow email messages to unresolved email recipients to be sent' to Yes.

    Then it allows sending emails to direct email addresses.

    For creating new email records programmatically follow the link given by Mahender or you can use the following links

    http://www.dylanhaskins.com/2008/08/sending-email-in-crm-40-using-sdk.html

    http://blogs.inetium.com/blogs/azimmer/archive/2009/08/08/crm-4-0-using-unresolved-email-addresses.aspx

    For sending emails:

    http://msdn.microsoft.com/en-us/library/bb959513.aspx

    Thanks and Regards

    Ramu

    http://www.osmosys.asia

    http://osmosee.wordpress.com

     

    • Proposed as answer by Janu_m Thursday, July 7, 2011 4:03 AM
    • Marked as answer by Pentium.lan Thursday, July 7, 2011 9:40 AM
    Thursday, July 7, 2011 4:02 AM
  • Thanks to all of you

    i read the the post of Janu_m, i achieved create an emial with email address, this is the code i have tested 

    List<Property> properties = new List<Property>();
    
          LookupProperty fromproperty = new LookupProperty();
          fromproperty.Name = "partyid";
          fromproperty.Value = new Lookup();
          fromproperty.Value.type = EntityName.systemuser.ToString();
          fromproperty.Value.Value = new Guid("5613F954-0362-DF11-A79C-005056A34C39");
          
    
          DynamicEntity entityfrom = new DynamicEntity();
          entityfrom.Name = EntityName.activityparty.ToString();
          entityfrom.Properties = new Property[] { fromproperty };
    
          DynamicEntityArrayProperty entityfromArray = new DynamicEntityArrayProperty();
          entityfromArray.Name = "from";
          entityfromArray.Value = new DynamicEntity[] { entityfrom };
          properties.Add(entityfromArray);
    
         
    
          StringProperty emailproperty = new StringProperty();
          emailproperty.Name = "addressused";
          emailproperty.Value = "sgao@hotmail.com";
    
          DynamicEntity entityto = new DynamicEntity();
          entityto.Name = EntityName.activityparty.ToString();
          entityto.Properties = new Property[] { emailproperty };
    
          DynamicEntityArrayProperty entitytoArray = new DynamicEntityArrayProperty();
          entitytoArray.Name = "to";
          entitytoArray.Value = new DynamicEntity[] { entityto };
          properties.Add(entitytoArray);
    
          StringProperty subject = new StringProperty();
          subject.Name = "subject";
          subject.Value = "TEST BL";
    
          properties.Add(subject);
    
          DynamicEntity emailentity = new DynamicEntity();
          emailentity.Properties = properties.ToArray() ;
          emailentity.Name = EntityName.email.ToString();
    
          TargetCreateDynamic createEmail = new TargetCreateDynamic();
          createEmail.Entity = emailentity;
    
          CreateRequest request = new CreateRequest();
          request.Target = createEmail;
          crmservice.Execute(request);
    
    thanks to all again

    Thursday, July 7, 2011 9:43 AM